What is TCP / IP?
TCP – Transmission Control Protocol
IP – Internetwork Protocol
TCP/IP refers to a collection of protocols
The name TCP/IP is misleading because TCP and IP are only two of the many protocols in this collection of protocols.
TCP is a reliable connection-oriented protocol with the following features:
1. Allows error-free transmission.
2. Incoming byte stream is fragmented into a number of shorter messages and these are passed on to the next layer.
3. At the receiving end the TCP reassembles the messages into an output stream 4. TCP also handles flow control – to control data transfer rate so that a slow receiver is not flooded with data from a fast sender.
5. A connection must be established between the sender and the receiver before transmission begins.
6. TCP creates a virtual circuit between sender and receiver for the duration of the transmission.
7. TCP begins each transmission by alerting the receiver that segments are on their way (connection establishment).
8. Each transmission is ended with connection termination.
Layers of TCP/IP Model:
Application |
Transport |
Internet |
Data Link |
Physical |
The TCP / IP suite does not define any specific protocols at the data link and physical layers.
The Application layer: This is equivalent to the combined OSI Session, Presentation, and Application layers. All the functions handled by these 3 layers in the OSI model is handled by the Application layer. This layer contains the higher level protocols: a. FTP – File Transfer Protocol – basic file transfer between hosts (computers) b. SMTP – Simple Mail Transfer Protocol (for email) c. HTTP – Hyper Text Transfer Protocol (for web browsing)
A data unit created at the application layer is called a message.
Encapsulation of Data: TCP/IP protocol suite encapsulates data units at various layers of the model
a. At the Application layer, the data unit created is called a message.
b. The Transport layer adds a header to form either a segment with TCP or a user datagram with UDP.
c. Each segment created by TCP includes:
i. A sequencing number for re-ordering after receipt.
ii. An acknowledgement ID number
iii. Source address and destination address
iv. Checksum – for error detection
v. Data
vi. And other fields
d. The Network (or Internet) layer adds another header to form a datagram. A datagram is a self-contained message unit which contains sufficient information to allow it to be routed from the source to the destination. The protocol used at the data link layer encapsulates the datagram into a frame and this is transmitted across the transmission medium.
Transport Layer:
• This layer is represented by two protocols – TCP (Transmission Control Protocol ) and UDP (User Datagram Protocol).
• UDP is simpler but is used when reliability and security are less important than size and speed – such as speech and video where a loss of few data is not significant, but speed is important.
Network Layer or Internetwork Layer
Internetwork Protocol (IP) is an unreliable and connectionless datagram protocol. It offers a best–effort delivery service. There is no error checking. IP does its best to get a transmission through to its destination but with no guarantees. Noise can cause bit errors during transmission, and datagrams maybe discarded due to timeout errors.
IP transports data in packets called datagrams:
• Each datagram is transported separately.
• Datagrams can be of variable lengths (upto 64 KB).
• Datagrams may travel along different routes and may arrive out of sequence. • IP does not keep track of the routes.
• IP does not have the facility to reorder datagrams once they arrive. • A datagram contains a header and data.
• The header contains a number of fields including source and destination address.
Comparison of OSI and TCP/IP Models:
o The OSI model makes a clear distinction between services, interfaces and protocols
o Each layer performs some service for the layer above it
OSI & TCP/IP Reference Models – Page 7 of 9
o A layer’s interface tells the processes above it how to access it. It specifies what the parameters are and what results to expect (somewhat like a function declaration)
o The protocols used in a layer are used to get the job done.
o The OSI model has 7 layers while the TCP/ IP model has 5 layers o Both have network, transport, and application layers, but the other layers are different
o OSI model supports both connectionless and connection-oriented communication o TCP/IP supports only connectionless communication
How TCP/IP works?
User application programs communicate with the top layer in the protocol stack. This layer passes information to the next subsequent lower layer of the stack, and so on till the information is passed to the lowest layer, the physical layer, which transfers the information to the destination network.
At the destination, the lower layer passes the received information to its higher levels, which in turn passes the data to the destination application. Each protocol layer performs various functions which are independent of the other layers. Each layer communicates with equivalent layers on another computer; this is called peer interaction
File Transfer using TCP / IP:
An application program, transferring files using TCP/IP, performs the following: At the sending end:
• the application layer passes the data to the transport layer of the source computer
• the transport layer
– divides the data into TCP segments
– adds a header with a sequence number to each TCP segment – passes the TCP segments to the IP layer
• the IP layer
– creates a packet with a data portion containing the TCP segment – adds a packet header containing the source and destination IP addresses
– determines the physical address of the destination computer – passes the packet and destination physical address to the datalink layer
• the datalink layer transmits the IP packet in the data portion of a frame At the receiving end:
• the destination computers datalink layer
– discards the datalink header and passes the IP packet to the IP layer
• the destination’s IP layer
– checks the IP packet header and checksum
– if okay, discards IP header & passes the TCP segment to the TCP layer
• the destination’s TCP layer
– computes a checksum for the TCP segment data and header – if okay, sends acknowledge to the source computer
– discards the TCP header and passes the data to the application
Questions
1. What is a peer-to-peer process? Explain with examples.
2. State the layers of the OSI mode and state the functions of each layer.
3. What is the difference between connectionless communication and connection oriented communication?
4. What are the reasons for using layered protocols?
5. What does “negotiation” mean when discussing network protocols?
6. If the unit exchanged at the data link layer is called frame and the unit exchanged at the network layer is called a packet, do frames encapsulate packets or do packets encapsulate frames? Explain your answer.
7. List two ways in which OSI and TCP/IP reference models are same and two ways in which they are different. 8. How do the layers of the TCP/IP model correlate to the layers of the OSI model?
References:
1. Data Communications Protocols – Part 1
2. Data Communications Protocols – Part 2
3. Solved Numerical Examples in Data Communications
(C) Mukesh N Tekwani, 2021
Categories: Blog, Computer Science, Data Communications & Networking
Leave a Reply