TCP/IP protocol based questions for gate computer science exam

Q1.What is the difference between transport and session layer of OSI model.


OSI Model Transport Layer

The transport layer uses the services provided by the network layer, such as best path selection and logical addressing, to provide end-to-end communication between source and destination. The transport -layer data stream is a logical connection between the endpoints of a network.

End-to-end control is provided by sliding windows and reliability in sequencing numbers and acknowledgments. The transport layer regulates information flow to ensure end-to-end
connectivity between host applications reliably and accurately.

The TCP/ IP protocol of Layer 4 (t transport t layer ) has two protocols. They are TCP and UDP.
The transport layer accepts data from the session layer and segments the data for transport across the network. Generally, the transport layer is responsible for making sure that the data is delivered error-free and in the proper sequence. Flow control generally occurs at the transport layer.

OSI Model Session Layer

The session layer establishes, manages, and terminates communication sessions. Communication sessions consist of service requests and service responses that occur between applications located on different network devices. These requests and responses are coordinated by protocols implemented at the session layer. 

The session layer establishes, manages, and terminates sessions between applications Functions of the session layer and the different processes that occur as data packets travel through this layer. More specifically, you learned that Communication sessions consist of mini-conversations that occur between applications located on different network devices. Requests and responses are coordinated by protocols implemented at the session layer.

The session layer decides whether to use two-way simultaneous communication or two-way alternate communication by using dialogue control.The session layer uses dialogue separation to initiate, terminate, and manage communication in an orderly fashion

Q2. What are differences between TCP/IP and OSI reference model?


We will be focusing only on the key differences between the two references

Three concepts are central to OSI model services, interfaces, and protocols. OSI model makes the clear distinction between these three concepts. The TCP/ IP model did not originally clearly distinguish between services, interface, and protocol.

For example, the only real services offered by the Internet layer are SEND IP packet and RECEIVE IP packet .

The OSI reference model was devised before the protocols were invented. This ordering means that model was not biased towards one particular set of protocols, which made it quite general.

With TCP/ IP reverse was true: the protocol came first, and the model was really just a description of the existing protocols. So the problem was model did not fit for any other protocol stack.

Another difference is in the area of connectionless versus connection-oriented communication. The OSI model support both connectionless and connection-oriented communication in the network layer, but only connection-oriented in the transport layer. The TCP/ IP model has only connectionless mode in network layer but supports both the mode in transport t layer.

Q3.Why is TCP called end-to-end protocol? 

Answer : TCP is called an end-to-end protocol because it provides a connection directly from an application on one computer to an application on a remote computer. The applications can request that TCP form a connection, send and receive data, and close the connection. The connections provided by TCP are called virtual connections because they are achieved in software.

TCP/IP based Study Material for  gate Computer Science

Q4.What is the use of an urgent pointer in TCP segment? 

Answer: To accommodate out of band signaling, TCP allows the sender to specify data as urgent, meaning that the receiving program should be notified of its arrival as quickly as possible, regardless of its position in the stream. For this purpose, Urgent pointer field is used. The mechanism used to mark urgent data when transmitting it in a segment consists of URG code bit and the URGENT POINTER field. When the URG bit is set, the urgent pointer specifies the posi ion in the segment where urgent data ends.

Q5.How does TCP take of wrapping over of sequence numbers? 

Answer: To handle out of order deliveries, transport protocols use sequencing. The sending side attaches a sequence number to each packet. The receiving side stores both the sequence number of the last packet received in order as well as a list of additional packets that arrived out of order. When a packet arrives, the receiver examines the sequence number to determine how the packet should be handled.

TCP takes care of wrapping over of sequence numbers by leaving a set of consecutive sequence numbers between initial sequence numbers of two TCP connection beginning within some specified time. This duration is known as a forbidden region.

Q6.How does TCP/ IP decide the size of an IP fragment? Explain. 

Answer: TCP/IP protocol uses the name IP datagram to refer to an Internet packet. The amount of data carried in a datagram is not fixed. The sender chooses an amount of data that is appropriate for a particular purpose. If the size of a datagram is larger than network MTU than fragmentation is performed.

When a datagram is larger than the MTU of a network over which it is sent, the router divides the datagram into smaller pieces called fragments and sends each fragment independently. To fragment a datagram for transmission across the network, a router uses the network MTU and datagram header size to calculate maximum amount of data that can be sent in each fragment and number of fragment that will be needed.

Q7.Is the TCP checksum necessary or could TCP allow IP to checksum the data? 

Answer: Yes, TCP Checksum is necessary. TCP layer is responsible for error detection, error control,  transmission of packets if required, reassembly of packets as well as their fragmentation.
Hence for all error control and detection purposes, TCP Checksum is essential.

TCP cannot allow IP to checksum data however IP has its own checksum for its header. IP layer is basically responsible for routing of IP datagrams immaterial of whether that packet is intended for TCP services or UDP services. Thus immaterial of what information is contained in data part , IP
layer is only responsible for routing of packets and all the issues related to error control, error detects ion, and flow control with regards to Routing only. Hence IP does not have a checksum for data, unlike TCP.

Q8.Could you directly use TCP over Ethernet without using IP? Justify.

Answer: Each Ethernet station has a unique, burned-in hardware address known as a Medium Access Control (MAC) address. No matter what higher layer protocols are being used, all addressing in Ethernet must be eventually done at layer 2 as a MAC. For example, if TCP/IP is being used at layers 3 and 4, each computer will be assigned a 32-bit IP address. Before communicating, an Ethernet attached station must resolve any IP address to a MAC address. This is done using Address Resolution Protocol, or ARP.

The address resolution protocol (ARP) is a protocol used by the Internet Protocol (IP),
specifically IPv4, to map IP network address to the hardware addresses used by a data link protocol. So we cannot directly use TCP without IP over Ethernet.

I hope this TCP/IP based gate study material for computer science will be beneficial for for gate aspirants.

Keywords: difference between osi and tcp/ip model, difference between transport and session layer,tcp checksum, IP fragment, what is tcp segment ?, what is urgent pointer in tcp segment , why tcp is called end to end protocol? ,difference between tcp and osi model ppt, difference between tcp and osi model pdf, difference between tcp and osi layer, difference between tcp and osi reference model, tcp segment checksum,