Professional Documents
Culture Documents
What is TCP/IP?
The Transmission Control Protocol/Internet Protocol (TCP/IP) suite of protocols was developed as part of the research done by the Defense Advanced Research Projects Agency (DARPA). The internet protocols can be used to communicate across any set of interconnected networks. They are equally well-suited for both LAN and WAN communication.
Examining the TCP/IP Protocol Stack The TCP/IP protocol stack maps closely to the OSI reference model in the lower layers. All standard physical and datalink protocols are supported.
The physical and data link layers of the TCP/IP stack are sometimes called the network interface layer.
TCP/IP Datagrams
TCP/IP information is transferred in a sequence of datagrams. One message may be transmitted as a series of datagrams that are reassembled into the message at the receiving location.
IP provides connectionless. It is not concerned with the content of the datagrams. Instead, it looks for a way to move the datagrams to their destination. ICMP provides control and messaging capabilities. ARP determines the data link layer address for known IP addresses. RARP determines network addresses when data link layer addresses are known.
Examining TCP
TCP is a connection-oriented, reliable protocol located in the transport layer of the TCP/IP Protocol Stack.
Functions of TCP
The following are general functions of the TCP Protocol:
TCP is responsible for breaking messages into segments, reassembling them at the destination station, resending anything that is not received, and reassembling messages from the segments. TCP supplies a virtual circuit between enduser applications
TCP Segment
Field definitions in the TCP segment follow:
Source Port - Number of the calling port (16 bits) Destination Port - Number of the called port (16 bits) Sequence Number - Number used to ensure correct sequencing of the arriving data (32 bits) Acknowledgment Number - Next expected TCP octet (32 bits) Header Length - Number of 32-bit words in the header (32 bits) Reserved - Set to zero (6 bits)
Code Bits - Control functions such as setup and termination of a session (6 bits) Window - Number of octets that the device is willing to accept (16 bits) Checksum - Calculated checksum of the header and data fields (16 bits) Urgent - Indicates the end of the urgent data (16 bits) Options - One currently defined: maximum TCP segment size (0 or 32 bits if any) Data - Upper-layer protocol data (varies)
The TCP header is 20 bytes. Transporting multiple packets with small data fields will result in less efficient use of available bandwidth than transporting the same amount of data with fewer, larger packets.
Examining UDP
UDP is a TCP/IP Transport Layer protocol designed for applications that provide their own error recovery process. It trades reliability for speed.
Characteristics of UDP
The following are characteristics associated with UDP:
UDP is simple and efficient, but not reliable. UDP is connectionless and unacknowledged.
UDP Segment
The UDP header length is always 64 bits.
Synchronization
For a connection to be established or initialized, the two hosts must synchronize on each other's Initial Sequence Numbers (ISN) .
Three-Way Handshake
The synchronization requires each side to send its own initial sequence number and to receive a confirmation of it in acknowledgement (ACK) from the other side. Each side must also receive the other side's initial sequence number and send a confirming ACK. This exchange is called the three-way handshake.The sequence follows:
Host A begins by sending a SYN segment indicating that host A will use sequence numbers starting with sequence number 100
Host B sends an ACK and acknowledges the SYN it received from host A. Host B also sends a SYN. Note that the acknowledgment field indicates host B is now expecting to hear sequence 101, acknowledging the SYN that occupied sequence 100.
In the next segment, host A sends some data. Note that the sequence number of the segment in step 3 is the same as the ACK in step 2.
The window size is the number of messages transmitted before the sender must wait for an acknowledgment. In the initial state, no messages are being sent.
Given a window size of 3, the source, in this case a router, sends 3 data segments to the destination. The destination sends an acknowledgement asking for the next set.
If the destination doesn't receive all three of the negotiated data segments, for example, due to a buffer overflow, it sends no acknowledgment. Since the source does not receive an acknowledgment, it knows the data segments should be retransmitted and the transmission should be slowed.
Examining IP
IP provides connectionless, best-effort delivery routing of datagrams. It is not concerned with the content of the datagrams. Instead, it looks for a way to move the datagrams to their destination.
IP Datagram
Version - Version number (4 bits) Header Length - Header length in 32bit words (4 bits) Priority and Type of Service - How the datagram should be handled. The first 3 bits are priority bits (8 bits). Total Length - Total length (header + data) (16 bits) Identification - Unique IP datagram value (16 bits) Flags - Specifies if fragmenting should occur (3 bits)
Fragment Offset - Provide fragmentation of datagrams to allow differing MTUs in the internet (13 bits) TTL - Time-To-Live (8 bits) Protocol - Upper-layer (Layer 4) protocol sending the datagram (8 bits) Header Checksum - Integrity check on the header (16 bits) Source IP Address - 32-bit source IP addresses (32 bits) Destination IP Addresses - 32-bit destination IP addresses (32 bits) IP Options - Network testing, debugging, security, and others (0 or 32 bits if any) Data - Upper-layer protocol data (varies)
ICMP
The Internet Control Message Protocol (ICMP) is implemented by all TCP/IP hosts. ICMP messages are carried in IP datagrams and are used to send error and control messages.
Reverse ARP
Reverse Address Resolution Protocol (RARP) relies on the presence of a RARP server with a table entry or other means to respond to these requests.
What is an IP Address?
In a TCP/IP environment, end stations communicate seamlessly with servers or other end stations. This communication occurs because each node using the TCP/IP protocol suite has a unique 32-bit logical IP address.
Purpose of IP Address
Each IP datagram includes the source IP address and destination IP address that identifies the source and destination network and host.
Class D and E addresses are also defined. Class D addresses start at 224.0.0.0 and are used for multicast purposes. Class E addresses start at 240.0.0.0 and are used for experimental purposes.
Class A addresses include the following: The first bit is 0. Range of network numbers: 1.0.0.0 to 126.0.0.0 Number of possible networks: 127 (1-126 usable, 127 is reserved) Number of possible values in the host portion: 16,777,216 (The number of usable hosts is two less than the number of possible because the host portion must be nonzero and cannot be all ones.)
Class B addresses include the following: The first two bits are 10. Range of network numbers: 128.0.0.0 to 191.255.0.0 Number of possible networks: 16,384 Number of possible values in the host portion: 65,536 (The number of usable hosts is two less than the number of possible because the host portion must be nonzero and cannot be all ones.)
Class C addresses include the following: The first three bits are 110. Range of network numbers: 192.0.0.0 to 223.255.255.0 Number of possible networks: 2,097,152 Number of possible values in the host portion: 256 (The number of usable hosts is two less than the number of possible because the host portion must be nonzero and cannot be all ones.)
Class D addresses include the following: Range of network numbers: 224.0.0.0 to 239.255.255.255