CH 3 Transport layer (Part 2)



Q5 Explain stop and wait protocol for simplex communication.        
Flow control deals with problem that sender transmits frames faster than receiver can accept, and solution is to limit sender into sending no faster than receiver can handle
Consider the simplex case: data is transmitted in one direction (Note although data frames are transmitter in one direction, frames are going in both directions, i.e. link is duplex)
Stop and wait protocol is explained below in Q6 do refer it.
This simple flow control done by stop and wait will break down if ACK gets lost or errors occur sender may wait for ACK that never arrives.

The figure is just for reference
For noisy link, pure stop and wait protocol will break down, and solution is to incorporate some error control mechanism
The simple method is to detect error by receiver, where receiver starts a timer as it sends a frame and waits for the next frames arrival if no frame arrives and timer gets expired then the receiver re-transmits the ACK so the sender can send the next frame. This also has an error which is if the timer expires and the sender has already transmitted the frame receiver gets duplicate data frame.








Q6 explain the working principle of stop and wait protocol.
In this method of flow control, the sender sends a single frame to receiver & waits for an acknowledgment.
This next frame is sent by sender only when acknowledgment of previous frame is received.
This process of sending a frame & waiting for an acknowledgment continues as long as the sender has data to send.
To end up the transmission sender transmits end of transmission (EOT) frame.
The main advantage of stop & wait protocols is its accuracy. Next frame is transmitter only when the first frame is acknowledged. So there is no chance of frame being lost.
The main disadvantage of this method is that it is inefficient. It makes the transmission process slow. In this method single frame travels from source to destination and single acknowledgment travels from destination to source. As a result each frame sent and received uses the entire time needed to traverse the link. Moreover, if two devices are distance apart. A lot of time is wasted waiting for ACKs that leads to increase in total transmission time.







Q7 Discuss the working principle of UDP
UDP stands for User Data-gram Protocol. UDP provides an unreliable packet delivery system built on top of the IP protocol. As with IP, each packet is an individual, and is handled separately. Because of this, the amount of data that can be sent in a UDP packet is limited to the amount that can be contained in a single IP packet. Thus, a UDP packet can contain at most 65507 bytes (this is the 65535-byte IP packet size minus the minimum IP header of 20 bytes and minus the 8-byte UDP header).
UDP packets can arrive out of order or not at all. No packet has any knowledge of the preceding or following packet. The recipient does not acknowledge packets, so the sender does not know that the transmission was successful. UDP has no provisions for flow control--packets can be received faster than they can be used. We call this type of communication connection less because the packets have no relationship to each other and because there is no state maintained.
The destination IP address and port number are encapsulated in each UDP packet. These two numbers together uniquely identify the recipient and are used by the underlying operating system to deliver the packet to a specific process (application). Each UDP packet also contains the sender's IP address and port number.
One way to think of UDP is by analogy to communications via a letter. You write the letter (this is the data you are sending); put the letter inside an envelope (the UDP packet); address the envelope (using an IP address and a port number); put your return address on the envelope (your local IP address and port number); and then you send the letter.
Like a real letter, you have no way of knowing whether a UDP packet was received. If you send a second letter one day after the first, the second one may be received before the first. Or, the second one may never be received.

Q8 Suppose a process in host C has a UDP socket with port number 6789. Suppose both hosts A and B each sends a UDP segment to host C with destination port number 6789. Will both of these segments be directed to the same socket at originated from two different hosts?
Yes, both of these segments will arrive to the same socket at host C because they have the same destination port number. In fact, UDP sockets are represented by the tuple. In this case, both packets would arrive at the UDP socket of host C which have port number 6789
Host C can differentiate between them by checking the source IP in the IP packet and the source port from the UDP header.



Q9 Explain sliding window protocol for sender and receiver
In sliding window method, multiple frames are sent by sender at a time before needing an acknowledgment.
Multiple frames sent by source are acknowledged by receiver using a single ACK frame.
Sliding window refers to an imaginary boxes that hold the frames on both sender and receiver side.
It provides the upper limit on the number of frames that can be transmitted before requiring an acknowledgment.
Frames may be acknowledged by receiver at any point even when window is not full on receiver side.
Frames may be transmitted by source even when window is not yet full on sender side.
The windows have a specific size in which the frames are numbered modulo- n, which means they are numbered from 0 to n-l. For e.g. if n = 8, the frames are numbered 0, 1,2,3,4,5,6, 7, 0, 1,2,3,4,5,6, 7, 0, 1, ....
The size of window is n-1. For e.g. In this case it is 7. Therefore, a maximum of n-l frames may be sent before an acknowledgment.
When the receiver sends an ACK, it includes the number of next frame it expects to receive. For example in order to acknowledge the group of frames ending in frame 4, the receiver sends an ACK containing the number 5. When sender sees an ACK with number 5, it comes to know that all the frames up to number 4 have been received.
At the beginning of a transmission, the sender's window contains n-l frames.
As the frames are sent by source, the left boundary of the window moves inward, shrinking the size of window. This means if window size is w, if four frames are sent by source after the last acknowledgment, then the number of frames left in window is w-4.
When the receiver sends an ACK, the source's window expand i.e. (right

boundary moves outward) to allow in a number of new frames equal to the number of frames acknowledged by that ACK.
For example, Let the window size is 7 (see diagram (a)), if frames 0 through 3 have been sent and no acknowledgment has been received, then the sender's window contains three frames - 4, 5, 6.
Now, if an ACK numbered 3 is received by source, it means three frames (0, 1, 2) have been received by receiver and are undamaged.
The sender's window will now expand to include the next three frames in its buffer. At this point the sender's window will contain six frames (4, 5, 6, 7, 0, and 1).

Q10 Explain stop and wait protocol for simplex communication.

(Same as question 5) (The question is repeated so that doesn’t mean I had nothing to upload here that means the question is IMP)

Q11 Write a short note on a) User Data-gram Protocol b) Connection Oriented v/s Connection-less services.
a)     User Data gram Protocol
UDP (User Data-gram Protocol) is an alternative communications protocol to Transmission Control Protocol (TCP) used primarily for establishing low-latency and loss tolerating connections between applications on the Internet. Both UDP and TCP run on top of the Internet Protocol (IP) and are sometimes referred to as UDP/IP or TCP/IP. Both protocols send short packets of data, called data-grams.
UDP provides two services not provided by the IP layer. It provides port numbers to help distinguish different user requests and, optionally, a checksum capability to verify that the data arrived intact.
TCP has emerged as the dominant protocol used for the bulk of Internet connectivity owing to services for breaking large data sets into individual packets, checking for and re-sending lost packets and reassembling packets into the correct sequence. But these additional services come at a cost in terms of additional data overhead, and delays called latency.
In contrast, UDP just sends the packets, which means that it has much lower bandwidth overhead and latency. But packets can be lost or received out of order as a result, owing to the different paths individual packets traverse between sender and receiver.
UDP is an ideal protocol for network applications in which perceived latency is critical such as gaming (which is my personal favorite), voice and video communications, which can suffer some data loss without adversely affecting perceived quality. In some cases, forward error correction techniques are used to improve audio and video quality in spite of some loss.
UDP can also be used in applications that require lossless data transmission when the application is configured to manage the process of re-transmitting lost packets and correctly arranging received packets. This approach can help to improve the data transfer rate of large files compared with TCP.
In the Open Systems Interconnection (OSI) communication model, UDP, like TCP, is in layer 4, the Transport Layer. UDP works in conjunction with higher level protocols to help manage data transmission services including Trivial File Transfer Protocol (TFTP), Real Time Streaming Protocol (RTSP), and Simple Network Protocol (SNP) and Domain Name System (DNS) look-ups. 
b)     Connection oriented v/s connection-less services
Two distinct techniques are used in data communications to transfer data. Each has its own advantages and disadvantages. They are the connection-oriented method and the connection-less method:
  • Connection-oriented    Requires a session connection (analogous to a phone call) be established before any data can be sent. This method is often called a "reliable" network service. It can guarantee that data will arrive in the same order. Connection-oriented services set up virtual links between end systems through a network, as shown in Figure 1. Note that the packet on the left is assigned the virtual circuit number 01. As it moves through the network, routers quickly send it through virtual circuit 01.
  • Connection-less    Does not require a session connection between sender and receiver. The sender simply starts sending packets (called data-grams) to the destination. This service does not have the reliability of the connection-oriented method, but it is useful for periodic burst transfers. Neither system must maintain state information for the systems that they send transmission to or receive transmission from. A connection-less network provides minimal services.
Above mentioned is enough for 3-4 marks if asked for more continue as below.
Connection-oriented methods may be implemented in the data link layers of the protocol stack and/or in the transport layers of the protocol stack, depending on the physical connections in place and the services required by the systems that are communicating. TCP (Transmission Control Protocol) is a connection-oriented transport protocol, while UDP (User Data-gram Protocol) is a connection-less network protocol. Both operate over IP.
The physical, data link, and network layer protocols have been used to implement guaranteed data delivery. For example, X.25 packet-switching networks perform extensive error checking and packet acknowledgment because the services were originally implemented on poor-quality telephone connections. Today, networks are more reliable. It is generally believed that the underlying network should do what it does best, which is deliver data bits as quickly as possible. Therefore, connection-oriented services are now primarily handled in the transport layer by end systems, not the network. This allows lower-layer networks to be optimized for speed.
LAN operate as connection-less systems. A computer attached to a network can start transmitting frames as soon as it has access to the network. It does not need to set up a connection with the destination system ahead of time. However, a transport-level protocol such as TCP may set up a connection-oriented session when necessary.
The Internet is one big connection-less packet network in which all packet deliveries are handled by IP. However, TCP adds connection-oriented services on top of IP. TCP provides all the upper-level connection-oriented session requirements to ensure that data is delivered properly. MPLS is a relatively new connection-oriented networking scheme for IP networks that sets up fast label-switched paths across routed or layer 2 networks.
A WAN service that uses the connection-oriented model is frame relay. The service provider sets up PVC's (permanent virtual circuits) through the network as required or requested by the customer. ATM is another networking technology that uses the connection-oriented virtual circuit approach.


Q12 same as Q4 it’s repeated so it’s IMP. ;)

  

Previous Page

 




Comments

Popular posts from this blog

Let's Get to shell scripting

Computer Networking Exam preparation material.

Lets Prepare for Object Oriented Programming with C++