CN
CN
CN
When a packet is corrupted or lost, the receiving transport layer can somehow inform the sending transport layer to
resend that packet using the sequence number.
Packets are numbered sequentially. If the header of the packet allows m bits for the sequence number, the sequence
numbers range from 0 to 2m – 1.
Acknowledgment Numbers
• ACK (Positive): Confirms successful receipt and indicates the next expected packet.
Connection-Oriented:
A connection is established between sender and receiver before communication.
Flow and Error Control:
Ensures smooth data flow and error handling during transmission.
Sliding Window Size of 1:
Only one packet is sent at a time
Sending Process:
The sender sends a packet and waits for acknowledgment before sending the next one.
Error Detection:
A checksum is added to each packet to detect corruption.
Timer Mechanism:
The sender starts a timer after sending a packet.
If acknowledgment is received before the timer expires, the sender sends the next packet.
Retransmission on Timeout:
If the timer expires, the sender resends the last packet, assuming it was lost or corrupted.
A copy of the packet is kept until acknowledgment is received.
Go-Back-N (GBN) Protocol
• To improve the efficiency of transmission (to fill the pipe), multiple packets must be in transition while the
sender is waiting for acknowledgment.
• Sender can send several packets before receiving acknowledgments, but the receiver can only buffer one
packet.
• We keep a copy of the sent packets until the acknowledgments arrive, data packets and acknowledgments
can be in the channel at the same time.
• The sequence numbers are modulo 2m, where m is the size of the sequence number field in bits.
• An acknowledgment number in this protocol is cumulative and defines the sequence number of the next
expected packet.
Selective-Repeat
Protocol :
The Go-Back-N protocol is inefficient if the underlying network protocol loses a lot of packets. Each time a single
packet is lost or corrupted, the sender resends all outstanding packets, even though some of these packets may have
been received safe and sound but out of order. If the network layer is losing many packets because of congestion in the
network, the resending of all of these outstanding packets makes the congestion worse, and eventually more packets
are lost. Selective-Repeat (SR) protocol, has been devised, which resends only selective packets, those that are
actually lost.
• The Selective-Repeat protocol also uses two windows: a send window and a receive window.
• The maximum size of the send window is much smaller; it is 2m−1
• The receive window is the same size as the send window.
Out-of-Order Packet Handling: The receiver can store packets that arrive out of order until the missing packets are
received.
Order of Delivery: Packets are delivered to the application layer only in the correct order.
• The receiver never delivers packets out of order to the application layer.
11. User Datagram Protocol
• The User Datagram Protocol (UDP) is a connectionless.
• UDP is a very simple protocol using a minimum of overhead. If a process wants to send a small message and does
not care much about reliability.
• Sending a small message using UDP takes much less interaction between the sender and receiver than using TCP.
UDP Services
Process-to-Process Communication: Process-to-process communication using socket addresses, a combination of IP
addresses and port numbers.
Connectionless Services:
• Each user datagram sent by UDP is an independent datagram.
• There is no relationship between the different user datagrams even if they are coming from the same source process
and going to the same destination program.
• UDP cannot send a stream of data to UDP and expect UDP to chop them into different, related user datagrams
Flow Control: UDP is a very simple protocol. There is no flow control, and hence no window mechanism. The
receiver may overflow with incoming messages.
Error Control: There is no error control mechanism in UDP except for the checksum, sender does not know if a
message has been lost or duplicated. When the receiver detects an error through the checksum, the user datagram is
silently discarded.
Checksum: UDP checksum calculation includes three sections: a pseudo header, the UDP header, and the data coming
from the application layer.
APPLICATIONS
Connectionless Service:
• Packets are independent of each other.
• Advantage: Ideal for short, quick exchanges (e.g., DNS).
o Connection-oriented protocols need 9 packets exchanged; UDP needs only 2.
Lack of Error Control:
• UDP does not ensure reliable delivery (no error checks or retransmissions).
• Advantage: Suitable for real-time applications (e.g., Skype, live video).
o Real-time calls prefer UDP since retransmissions might cause delays.
Lack of Congestion Control:
• UDP sends data without worrying about network congestion.
• Advantage: Avoids adding to congestion unlike TCP, which may resend lost packets and increase traffic.
TCP SERVICES :
1. Process-to-Process Communication:
Process-to-process communication using port numbers.
2. Stream Delivery Service:
• Data is delivered as a continuous stream of bytes.
• TCP connects two processes via an "imaginary tube" for seamless data transfer.
• The sender writes data into the stream, and the receiver reads from it.
3. Sending and Receiving Buffers:
• Buffers handle differences in reading/writing speeds between sender and receiver.
• Each direction (send and receive) has its own buffer:
o Sender Buffer:
▪ White section: Empty space for new data.
▪ Colored section: Data sent but not yet acknowledged.
▪ Shaded section: Data ready to be sent.
▪ Acknowledged data frees up space in the buffer for reuse.
o Receiver Buffer:
▪ White section: Space for incoming data.
▪ Colored section: Data ready for the application to read.
▪ Read data frees up buffer space for new incoming data.
4. Segments:
• Data is divided into smaller units called segments.
• Each segment:
o Contains a TCP header for control.
o Is encapsulated in an IP datagram for transmission.
• Segment sizes vary, often carrying hundreds or thousands of bytes.
5. Full-Duplex Communication:
• Data flows simultaneously in both directions.
6. Multiplexing and Demultiplexing:
• Multiplexing: Combines data from multiple processes at the sender.
• Demultiplexing: Delivers data to the correct process at the receiver.
7. Connection-Oriented Service:
• TCP ensures a logical connection is established before data transfer begins.
• Enables bidirectional data exchange and orderly termination of the connection after communication.
Reliable Service: TCP is a reliable transport protocol. It uses an acknowledgment mechanism to check the safe and
sound arrival of data.
14. Segment format
Header and Data:
o Header size: 20 to 60 bytes.
▪ Minimum: 20 bytes (no options).
▪ Maximum: 60 bytes (with options).
o Follows the data from the application program.
Header Fields:
1. Source Port Address:
o 16-bit field.
o Specifies the port number of the sending application.
2. Destination Port Address:
o 16-bit field.
o Specifies the port number of the receiving application.
3. Sequence Number:
o 32-bit field.
o Identifies the number of the first byte in the segment.
o During connection setup, each side generates an Initial Sequence Number (ISN).
4. Acknowledgment Number:
o 32-bit field.
o Indicates the next byte expected by the receiver.
o Example: If byte x is received, the acknowledgment number will be x+1.
5. Header Length:
o 4-bit field.
o Indicates the header size in 4-byte words.
o Values range from 5 (20 bytes) to 15 (60 bytes).
6. Control Flags:
o 6 control bits manage:
▪ Flow control.
▪ Connection establishment and termination.
▪ Data transfer modes.
7. Window Size:
o 16-bit field.
o Specifies the size of the receiver’s window (maximum: 65,535 bytes).
o Determines how much data can be sent without acknowledgment.
8. Checksum:
o 16-bit field.
o Ensures data integrity.
o Mandatory in TCP (optional in UDP).
o Uses a pseudo header for computation.
9. Urgent Pointer:
o 16-bit field (used only if urgent flag is set).
o Indicates the last urgent byte’s position by adding its value to the sequence number.
10. Options:
o Up to 40 bytes for additional functionalities.
With FSM model explain Reno TCP and how it differs from NewReno TCP
3. NewReno TCP:
• Optimization on Reno:
o Detects and handles multiple lost segments in the same congestion window.
• How It Works:
1. Upon three duplicate ACKs, retransmits the first lost segment.
2. Waits for a new ACK (not a duplicate):
▪ If the ACK acknowledges the entire window, only one segment was lost.
▪ If the ACK acknowledges up to a point but not the full window:
▪ Additional segments are likely lost.
▪ NewReno retransmits these lost segments to prevent further duplicate ACKs.
4. Key Advantage of NewReno:
• Better handling of multiple segment losses without exiting Fast Recovery prematurely.
Summary:
• Reno TCP: Improves efficiency by introducing the Fast Recovery state, avoiding aggressive resets like
Tahoe.
• NewReno TCP: Further refines congestion control by efficiently addressing multiple lost segments in a single
window.
MODULE – 05
Key Components:
1. Alice and Bob - Alice is on one end (Sky Research), and Bob is on the other (Scientific Books). - Both have
devices (laptops and servers) connected to their respective networks.
2. Routers and Connections - The routers (R1, R2, R3, etc.) are the main devices that send data across the network. -
These routers connect through point-to-point WAN links (dotted lines), forming a network that allows Alice and Bob
to communicate.
3. Switched WAN - In the middle of the network, there is a switched WAN (Wide Area Network) connecting multiple
routers (R3, R4, and R5). - This helps move the data efficiently across the national ISP (Internet Service Provider).
4. Logical Connection - The blue line labeled "Logical Connection" shows the path that data takes to travel between
Alice and Bob. - Even though the data passes through many routers and links, to Alice and Bob, it looks like a
simple, direct connection.
5. Network Layers - The diagram uses color codes to represent the different layers of communication: - Application
(top layer, blue): The software Alice and Bob use. - Transport, Network, Data-link, and Physical layers: These layers
handle how the data moves from one device to another.
2. Explain Application Layer Paradigms need for Application Layer.
Client-Server Paradigm (Traditional):
• How It Works:
o The server process provides a service and runs continuously, waiting for client processes to connect
and request services.
o The client process starts only when the client needs the service.
o One server can serve multiple clients simultaneously.
• Examples:
o Common applications: HTTP (Web browsing), FTP (File transfer), SSH (Secure shell), and Email.
• Limitations:
1. High communication load on the server.
2. Server may get overwhelmed with too many client connections.
3. Expensive to maintain powerful servers.
3. Mixed Paradigm:
• Combination of Both:
o Uses a lightweight client-server model to find peers.
o Actual services are delivered peer-to-peer once the peer is identified.
• Example:
o A central server helps locate the appropriate peer, and the peer-to-peer paradigm is used for service
delivery.
Key Takeaways:
• Client-Server: Reliable but limited by server capacity and cost.
• Peer-to-Peer: Scalable and cost-effective but challenging in terms of security.
• Mixed: Combines the benefits of both for specific use cases.
\
3 How Application interface impacts on Client Server programming.
1. Purpose of API:
• Enables a process (application) to communicate with
another process over a network.
• Provides instructions for:
o Opening a connection.
o Sending and receiving data.
o Closing the connection.
2. What is an API?:
• An interface that defines a set of instructions between two entities:
o Application layer process.
o Operating system, which handles the lower layers of the TCP/IP protocol suite.
3. Common APIs for Communication:
1. Socket Interface:
o Introduced in the early 1980s at UC Berkeley as part of the UNIX system.
o Provides a set of instructions for communication between the application and the operating system.
o Widely used due to its simplicity and flexibility.
2. Transport Layer Interface (TLI):
o Another API for communication, but less commonly used compared to sockets.
3. STREAM:
o Provides communication instructions based on a stream-oriented approach.
4. How Application layer influence the services of the Transport Layer.
5. Bring out the difference Interactive communication using UDP and TCP.
6. With a neat Architecture diagram explain World Wide Web, How web browser interacts with web server
• Definition: A new TCP connection is created for each request/response. After sending the response,
the server closes the connection.
Example:
Overhead: For each item (HTML, image), a new connection is opened and closed, which slows down the
process.
• Definition: The server keeps the connection open for multiple requests. The connection is closed
either by the client or after a timeout.
Example:
Advantages: Only one connection is needed for multiple requests, reducing overhead and saving time.