TCP/IP: TCP/IP overview
TCP/IP separates a full network protocol suite into a number of tasks.
4 Layers of TCP/IP Stack:
- Application: Allows programs that have been create4d for a particular OS to asscess the network. Provides applications for internet activities, network troubleshooting and file transfer. The following protocols apply to the Application Layer:
- HTTP (HyperText Transfer Protocol)
- FTP (File Transfer Protocol)
- SMTP (Simple Mail Transfer Protocol)
- TFTP (Trivial File Transfer Protocol)
- NFS (Network File System)
- Transport: Provides communication services directly to the application processes that run on network hosts. The Transport Layer contains the following protocols:
- TCP (Transmission Control Protocol)
- UDP (User Datagram Protocol)
- Internet: Moves data between OSI data-link and transport layers. Defines the packet and addressing scheme and routes data packets to remote hosts or networks. Provides the routing data from the source to a destination. The protocols that apply to the Internet Layer are:
- ICMP (Internet Control Message Protocol)
- ARP (Address Resolution Protocol)
- RARP (Reverse Address Resolution Protocol)
- BOOTP (Bootstrap Protocol)
- Network Access: Combines OSI Physical and Data-link layers. Physical layer defines specifications such as: physical connectors, maximum transmission distances, and physical data rates. Data-link layer specifices how network access s controlled and hot to format data for transmission. The network access layer support the following topologies:
- Ethernet
- FDDI (Fiber Distributed Data Interface
- Token Ring
- Other Topologies
TCP/IP consists of 2 separate protocol functions:
- TCP: uses network layer below to move packets between two communicating devices. The transfer of data between the two devices is transparent.
- TCP Characteristics: Operates at a higher level. Breaks message packets into smaller packets before they are transported. These small packets are then sent across the internet and received at the destination. The TCP layer of the destination reassembles the small packets into the orginal message.
- Transport Layer Protocol (OSI)
- IP: uses packets to transsmit information trhough the network. A packet is an independent unit of data that carries sufficient information to be routed from source to destination – this occurs without reliance on earlier exchanges.
- IP Characteristics: Carried out at the lower level and deal with the addressing of packets. When each packet reaches one of th gateway computers on the network, the computer read the address to find out where to forward the packet.
- Network Layer Protocol (OSI)
Benefits of TCP/IP:
- Open Standard
- Independant of hardware (will run over phone lines, token ring, ethernets, or x.25 networks)
- reliable and effecient
- routable protocol (can be transmitted over a specific route to reduce traffic on certain parts of the network.)
- common addressing scheme – easy for devices on the network to address one another
TCP/IP: Network Layer Functionality
OSI Network Layer routes packets for information from the source to the destination. The Network layer performs four tasks to carry out this routing procedure.
- Defines the packet and addressing scheme
- Moves data between the OSI Data-Link layer and the OSI Transport Layer
- Routes information packets to remote hosts
- Performs fragmentation and reassembly of information packets
OSI Network Layer protocols:
- IP (Internet Protocol): Ip provides best-effort delivery. It concentrates on the route each packet should take to get to its destination. IP does not read the content of the packets, because it is soles interested in routing the packet to its destination.
- ICMP (Internet Control Message Protocol): Control and messenging capabilities are provide by ICMP
- ARP (Address Resolution Protocol): When the IP address is known, ARP establishes the correstponding MAC address
- RARP (Reverse Address Resolution Protocol): When the MAC address is known, RARP establishes the corresponding IP address
- DHCP (Dynamic Host Configuration Protocol): provides a structure to enable IP hosts to be configured automatically
Characteristics of IP:
- Lost of corrupted packets are not recoverd: (Lost/Corrupted packets are taken care of the end system.)
- Packets are treated independently: Each packet carries the addresses of its sender and receiver
- Pacekt Delivery is not guaranteed: Packets can get lost, misdirected or duplicated on the way to their destination
TCP/IP common Protocols:
ICMP (Internet Control Message Protocol): Internet protocol that is used to respond to errors in TCP/IP messages. Specifies a small number of messages that are used for identification and management purposes. ICMP relies on IP to transport packets around the network.
Key characteristics of ICMP:
- announcing network errors: indicates if a host or portion of the network cannon be reached because of failure. Reports is a packet is directed at a port number that has no active receiver.
- announcing network congestion: when a router cannot transmit messages as fast as it is receiving them, the router generates source quench messages – asking the sender to reduce the rate at which it is transmitting packets onto the network.
- assisting troubleshooting: uses an echo function. Sends a special packet on a round trip between two hosts. PING (a network managment app based on the echo fucntion) transmits a series of packets, measures the average round-trip times, and computer the percentage of packets lost.
- announcing timeouts: a router discards packets if they have been in the ntework for too long. When using ICMP, the routers generates and ICMP packet announing that it is dicarding the packet. TRACEROUTE is a tool that sends out packets to map the routes in the network. These packets have a small time-to-live values and the Traceroute tool watches the ICMP timeout announcements.
Delivery of ICMP packets is UNRELIABLE
IGMP (Internet Group Management Protocol): is used by IP Hosts between themselves and their immediate neighbor multicast agents to regiester which group they are a member of, add or delete memeber of a group, and regularly confirm their membership of a group. It is also used by routers that are connected to find out the members of the groups.
ARP (Address Resolution Protocol): Maps IP addresses to the MAC addresses. Address Resolution is the process of binding the network-layer IP address of a remote comptuer in an Ehternet network to its data-link layer MAC address.
ARP Cache: a table of IP addresses and their corresponding MAC addresses.
2 Types of messesages sent by the protocol are “ARP request” and “ARP reply”
RARP (Reverse Address Resolution Protocol): translates physical addresses (is MAC addresses and hardware interface addresses into IP addresses.) When a host, for example a diskless workstation, is turned on it may know its physical address but not its IP address. The host must learn its IP address from an external source. Normally this external source is the RARP server.
2 Types of messesages sent by the protocol are “RARP request” and “RARP reply”
DHCP (Dynamic Host Configuration Protocol): use to automatically asign IP addresse and to deliever TCP/IP stack configureation parameters (ie the default gateway and subnet mask). It can also be used to provide other configuration information (ie addresses for printers, news and time servers.)
DHCP has 2 components:
- A protocol that delivers host-specific configuration parameters from the DHCP server to a host
- a method of allocating a network addresses to hosts
TCP/IP: Transport Layer Functionality
Characteristics of TCP:
- connection-oriented protocol: to exchange data two computers set up a connection between them. They synchronize the end systems so that they can control the flow of packets and adapts to congestion on the network.
- Full-Duplex Operation: consists of a pair of virtual circuits – one in each direction. Only the two end stystems that are synchronized can use the connection.
- Error Checking: is provided by a checksum technique to verify that packets are not corrupt.
- Sequencing: Packets are sequenced and numbered. Using the sequence numbers the destination device can put the packets in order and determine if any packets are missing.
- Acknowledgements: The reciever sends and ackowledgment to the sender when it recieves one or more packets. If the sender does not recieve and acknowledgment then it may resend the packets or terminate the connection if it believes the receiver is no longer on the connection.
- Flow Control: occurs if the sender is transmitting too quickly and the buffer of the recievers overflows. If this happens the reciever drops packets. The sender learns that it should slow down or stop sending packets through the failed acknowledgements.
- Packet Recovery: The reciever can use the packet recovery services and request a packet to be retransmitted. The sender will retransmit the packets if the receipt of a packet is not acknowledged
There are 12 Feilds in the TCP header.
Port Numbers have the following assigned ranges:
- numbers below 1024 are assigne to well-known port
- from 1025 to 49151 there are registered ports that are listed by the IANA (Internet Assigned Numbers Authority)
- from numbers 49152 to 65535 they are assigned to dynamically assigned ports
End systems select the proper applications by using the port numbers. Port number identify the upper-layer protocol that uses the transport layer.
TCP connection setup and termination
When using TCP, a connect must be established between the two end systems before data transfer can begin. This connection is established using synchronization (SYN) and postive acknowledgment (ACK) segments betweent the two devices.
Another important function performed during the connection establishemtn is that the other device is informed of the Initial Sequence Number (ISN). This is used to track data byes on the connection.
3 step Connection Setup Procedure:
- Host A: Send SYN: The device requesting a connection sends a SYN segment to the receiving device. The SYN contains the prot number and the first sequence number otherr device that the sender wants to connect to. The SYN control bit is set during the connection setup phase, in order to send the ISN.
- Host B: Send SYN, ACK – Ack = 101: The receiving device replies with an ACK segment and a SYN. The receiving device indicate the sequence number it expects from the next byte of data to be received. This sequence number is the sender’s ISN increased by one, because the SYN uses one byte of the sequence space.
- Host A: Send ACK - Ack = 301: The initiating device acknowledges the SYN segment from the reciver. The SYNn bit is unset in the TCP header.
TCP sequences segments and uses a forward reference acknowledgment. Each segment is numbered before it is transmitted. When the segments are recived by the other device, TCP reassembles them in the correct order to create a complete message.
If there is a sequence number missing in the series, that segment and all of the segments sent after it are retransmitted. If a segment is not acknowledged within a specific period of time, it is retransmitted.
When all the data has been transmitted, the conection is terminated.
3 Step Connection Terminatio Procedure:
- Host A: Send FIN – seq = 100 – ctl = FIN: The sending device send a segment to the reciving device with the finishing control code, FIN set to one
- Host B: Send FIN ACK – seq = 300 Ack = 101 Ctl = FIN ACK: Receipt of the segment is acknowledged by the receiving device. The control code in the TCP header is set with FIN=1 in the ACK
- Host A: Send ACK: The connection is terminated after the sending device acknowledges the acknowlegdment from the receiving device.