+
TCP Header Diagram
+
Additional Detail
+
Source and Destination Ports
+
A port is a virtual entity to allow simultaneous TCP services to operate on the same physical hardware. The name is taken from the analogy with a ‘port’ or ‘plug’ that may be found on the back of a computer.
+
Consider a small business situation, where a local area network centres of a single network server, performing a variety of network services. The company intranet requires that a web server is running along with a database server for content. Company email passes through the send/fetch mail daemons, while company internet access is logged and filtered using a Web Proxy. The server itself can be remotely maintained from anywhere in the LAN using the SSH remote access protocol.
+
All of the above provide a network service, but they are able to co-exist because each operates on a unique port.
+
+
In a web browser, connecting to a website on a non-standard port can often take the format ‘http://www.example.com:8080’. However, ports are not related to the external network routing of TCP packets - that relates to the DNS resolution and the IP address stored in the IP header - on top of the TCP Header. Instead, ports provide a means for computers at each end of a network transaction to internally direct network packets to the appropriate service. Each unique port is maintained with its own data buffer, enabling each network service to operate independently.
+
In the above example, all network users will connect to the server machine. A user can browse an external Internet source through the web proxy on port 3126, while at the same time the system administrator can be directly manipulating the server through an SSH connection on port 22. While physically the services reside on the same machine, virtually (or ‘logically’) they are separate entities.
+
NB: While the example above may imply it, a service running on a single port is not restricted to a single user at one time. Multi-User behaviour is handled entirely by that service. Each service will have its own manner for handling multiple connections (for instance - Apache web server has a setting for ‘maximum number of client connections allowed at once’).
+
The TCP Header contains two Port items - Source and Destination. In a client-server situation like that above the default Destination port for a client connecting to the company web server will be ‘80‘. The Source port will be variable and assigned by the client browser or Operating System. A summary of client connections on a Windows or Unix machine can be found by running netstat -a -n -o -p tcp from the command prompt. This returns:-
+
+
D:\bmpw>netstat -a -n -o -p tcp
+Active Connections Proto Local Address Foreign Address State
+ TCP 10.1.103.166:2020 213.129.226.165:80 CLOSE_WAIT
+ TCP 10.1.103.166:4303 207.46.110.40:80 ESTABLISHED
+ TCP 10.1.103.166:4438 207.46.110.26:80 ESTABLISHED
+ TCP 127.0.0.1:1437 127.0.0.1:1438 ESTABLISHED
+ TCP 127.0.0.1:1438 127.0.0.1:1437 ESTABLISHED
+
+
In the above trimmed output, it can be seen that as well as using ports to connect to remote services (where the local address is listed as 10.1.103.166, the network host IP of the machine) ports are also used to run local services - such as those running on ports 1437 and 1438 on localhost (ip:127.0.0.1).
+
+
Checksum
+
The checksum of the TCP header is an error detection method.
+It uses a method in which a 16 bit number is passed based on the
+number of bits in the message (The header and the data). The
+receiving machine can then sum the total of the 16 bit words and
+if the total of this ones compliment number is zero
+(1111111111111111) then the message can be considered correct.
+If the sum of them is not zero then the message can be considered
+to have lost its integrity during transfer. This method can not
+correct the data; it can only tell if it has lost its
+integrity.
+
While calculating the checksum the field of the checksum is
+set to zero. The sum of all the 16 bit words in the TCP segment
+header and TCP segment data is taken and then inverted (The
+1’s compliment of it taken). If there are not enough bits
+then zeros are used to pad the data out so that a checksum can
+still be made. This is then put into the checksum field of the
+TCP header.
+
Example
+
If we were to come up with the following words from the TCP
+segment Header and TCP segment data together:
+
Word 1 : ABCD
+Word 2 : 1903
+Word 3 : 1984
+Word 4 : 5744
+Checksum : 0000 (Set to 0 while calculating)
+
+
The ones compliment sum of these numbers gives us:
+
+
Word 1 : 1010101111001101
+Word 2 : 0001100100000011
+Word 3 : 0001100110000100
+Word 4 : 0101011101000100
+Checksum : 0000000000000000
+ ----------------
+Sum : 0011010110011000
+Inverted : 1100101001100111(1’s compliment)
+ ----------------
+
+
When this is received the receiving computer
+would get the 5 words and completes the following sum:
+
Word 1:1010101111001101
+Word 2:0001100100000011
+Word 3:0001100110000100
+Word 4:0101011101000100
+Checksum:1100101001100111
+ ----------------
+1111111111111111
+
Because we have got zero from the sum of the
+words we can treat this as the data being sent has been sent
+correctly and has its integrity.
+
+
Window
+
The Window field is used in flow control, in order to ensure that the sender does not send too much data for the receiver to keep up with. The field is 16 bits long, and contains the number of data octets relative to the sequence number in the Acknowledgement Number field, that can be sent.
+
Each segment is assigned a Sequence Number, and a ‘window’ is placed over the stream, see below (a)
+
As the first segment is sent, the trailing edge of the window contracts (b)
+
As the acknowledgement for segment 0 is received, the leading edge of the window expands. (c). In this way, the window moves along the bit stream, and restricts the number of segments which can be sent at any time to those inside the window.
+
This allows the sender to continually send data as long as the window is ‘open’, and can send more than one segment before receiving acknowledgement (d) and (e)
+
+
+
+
+
+
diff --git a/nextjs/public/static/projects/tcp-header/images/arrow.png b/nextjs/public/static/projects/tcp-header/images/arrow.png
new file mode 100755
index 0000000..37084fa
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/arrow.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/bg_diagram.png b/nextjs/public/static/projects/tcp-header/images/bg_diagram.png
new file mode 100755
index 0000000..4e5adeb
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/bg_diagram.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/bg_globe.png b/nextjs/public/static/projects/tcp-header/images/bg_globe.png
new file mode 100755
index 0000000..42fd76f
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/bg_globe.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/cell_off.png b/nextjs/public/static/projects/tcp-header/images/cell_off.png
new file mode 100755
index 0000000..cc964b0
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/cell_off.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/cell_on.png b/nextjs/public/static/projects/tcp-header/images/cell_on.png
new file mode 100755
index 0000000..318dcc2
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/cell_on.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/diagram.png b/nextjs/public/static/projects/tcp-header/images/diagram.png
new file mode 100755
index 0000000..9678c0f
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/diagram.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/originals/cell_gradient.psd b/nextjs/public/static/projects/tcp-header/images/originals/cell_gradient.psd
new file mode 100755
index 0000000..168ffba
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/originals/cell_gradient.psd differ
diff --git a/nextjs/public/static/projects/tcp-header/images/ports.gif b/nextjs/public/static/projects/tcp-header/images/ports.gif
new file mode 100755
index 0000000..0e07c8f
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/ports.gif differ
diff --git a/nextjs/public/static/projects/tcp-header/images/ports.png b/nextjs/public/static/projects/tcp-header/images/ports.png
new file mode 100755
index 0000000..f939b1f
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/ports.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/screenshots/01.png b/nextjs/public/static/projects/tcp-header/images/screenshots/01.png
new file mode 100755
index 0000000..7a6ad92
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/screenshots/01.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/screenshots/02.png b/nextjs/public/static/projects/tcp-header/images/screenshots/02.png
new file mode 100755
index 0000000..c8ca9ad
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/screenshots/02.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/screenshots/03.png b/nextjs/public/static/projects/tcp-header/images/screenshots/03.png
new file mode 100755
index 0000000..61b0d77
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/screenshots/03.png differ
diff --git a/nextjs/public/static/projects/tcp-header/images/window.png b/nextjs/public/static/projects/tcp-header/images/window.png
new file mode 100755
index 0000000..02371e8
Binary files /dev/null and b/nextjs/public/static/projects/tcp-header/images/window.png differ
diff --git a/nextjs/public/static/projects/tcp-header/index.xht b/nextjs/public/static/projects/tcp-header/index.xht
new file mode 100755
index 0000000..fb5e343
--- /dev/null
+++ b/nextjs/public/static/projects/tcp-header/index.xht
@@ -0,0 +1,273 @@
+
+
+
+
+
+