0% found this document useful (0 votes)
4 views

Lecture 6 Sumcsc 430

Uploaded by

omarobeidd03
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture 6 Sumcsc 430

Uploaded by

omarobeidd03
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Lecture 6:

1) Transport layer: which is crucial for enabling communication between application processes on
different hosts in a network.
2) Logical Communication: The transport layer facilitates the illusion of a direct connection
between application processes running on different hosts, even though the data might travel
through multiple intermediate nodes.
3) Transport Protocols Run in End Systems: Unlike some protocols that operate in intermediate
network devices (like routers), transport protocols are implemented at the endpoints of a
communication session.
4) Segmentation and Reassembly:
 Send Side: Application messages are divided into smaller units called segments. This
process is necessary because network infrastructure can handle only limited sizes of
data packets. After segmentation, these segments are passed down to the network layer
for delivery.
 Receive Side: The transport layer collects these segments, reassembles them into the
original messages, and then delivers them to the application layer. This ensures the
application receives the entire message as intended.
5) Two Primary Transport Protocols:
 TCP (Transmission Control Protocol): Provides reliable, ordered delivery of a stream of
bytes. It includes error checking, flow control, and congestion control mechanisms. TCP
is used when the accuracy of data delivery is critical, such as in web browsers, email,
and file transfers.
 UDP (User Datagram Protocol): Offers a simpler service by sending messages, called
datagrams, without establishing a dedicated end-to-end connection. UDP is faster but
does not guarantee delivery, order, or error-free transmission. It's suitable for
applications where speed is crucial and occasional data loss is acceptable, such as
streaming media, online games, and voice over IP (VoIP).
6) Network layer: logical communication between hosts
7) Transport layer: logical communication between processes
8) Household analogy: 12 kids sending letters to 12 kids • Processes (applications) = kids • app
messages = letters in envelopes • hosts = houses • transport protocol: — jad: will do his best —
Sarah: will guarantee delivery • network-layer protocol = postal service
9) Multiplexing at Send Host: This is the process of combining data from multiple application-layer
sockets into a single transport-layer segment. Each piece of data is enveloped with a header that
contains important control information. This header plays a crucial role in the later process of
demultiplexing. Multiplexing allows for efficient utilization of the network resources by enabling
multiple communications to be carried out over a single connection.
10) Demultiplexing at Receive Host: Upon receiving segments, the transport layer performs the
reverse operation of multiplexing, known as demultiplexing. It uses the headers attached to
each segment to determine the appropriate destination socket for the data. This process
ensures that each piece of data is delivered to the correct application process.
How it works:
 Receipt of IP Datagrams: When a host receives an IP datagram, this packet includes both
source and destination IP addresses. These addresses are part of the Layer 3 (Network
Layer) information, which helps in routing the datagram through the network to reach
the correct host.

 Transport-Layer Segment: Inside each IP datagram is a transport-layer segment. This


segment contains its own set of headers, including source and destination port
numbers. These port numbers are critical Layer 4 (Transport Layer) information,
providing specific endpoints for communication between applications on hosts.

 Demultiplexing Process: The host uses the combination of IP addresses (to identify the
destination host) and port numbers (to identify the specific application or process within
the host) to direct the segment to the appropriate socket. A socket is a network
endpoint for sending and receiving data, and each socket on a host is uniquely identified
by the combination of an IP address and a port number.

11) Port Numbers:


 Port numbers are not globally unique across all transport layer protocols. Instead, their
uniqueness is scoped within a particular protocol.
 Both TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) use port
numbers, but they manage their port spaces independently. This means TCP and UDP
can use the same port number for different services or applications without conflict.
 The unique identifier for a given service or application process is not just the port
number but the combination of the transport layer protocol (TCP or UDP) and the port
number. This combination allows the network stack to correctly deliver data to the
intended application.
 Well-known ports are standardized and reserved for specific services, making it easier
for remote computers to connect to these services. For example, the Telnet service is
traditionally associated with port 23. Knowing this, a client can connect to a remote
server's Telnet service by directing traffic to port 23.
 These well-known ports (typically those below 1024) ensure that standard services are
accessible at predictable locations across the internet or local networks.
 Dynamically allocated (or ephemeral) ports are used for the client side of a connection.
When a client initiates a connection to a server, the client's source port is assigned a
temporary port number from this range. This allows multiple sessions to be
distinguished from one another, supporting multiple concurrent connections.
 The flexibility of dynamically allocated ports, combined with the predictability of well-
known ports, ensures that networked applications can communicate effectively and
efficiently, supporting both standardized services and a multitude of simultaneous user
connections.
12) Connectionless Multiplexing:
 Connectionless Multiplexing and UDP Sockets: In a connectionless protocol like UDP,
sockets are identified by a combination of three elements: the protocol ("UDP"), the
destination IP address, and the destination port number. This tuple uniquely identifies a
UDP socket and enables the host to direct incoming UDP segments to the correct
application process.
 Handling Incoming UDP Segments: When a host receives a UDP segment, it examines
the destination port number contained within the segment. It then directs the segment
to the socket associated with that port number. This means that all UDP segments
directed to a particular port, regardless of their source IP address or source port
number, will be routed to the same socket.
 JAVA Example: JAVA Create sockets with dynamic port number (client side):
DatagramSocket mySocket1 = new DatagramSocket( );
Automatically assigned between 1024 and 65535 (not used by any other UDP)
Create sockets with port numbers (server side):
DatagramSocket mySocket1 = new DatagramSocket(53);
13) Connection Oriented Multiplexing:
 5-Tuple Identification: TCP sockets are uniquely identified by a combination of five
elements: the protocol (TCP), the source IP address, the source port number, the
destination IP address, and the destination port number. This detailed identification
enables precise routing of messages across the network.
 Routing to Correct Socket: Upon receiving a TCP segment, the receiving host's TCP layer
examines the segment's source and destination information (IP addresses and port
numbers). It uses this information to ensure the segment is directed to the appropriate
socket, facilitating accurate communication between specific applications on different
hosts.
 Multiple Simultaneous Sockets: Servers, particularly those hosting web services, are
capable of handling many simultaneous connections. Each connection is maintained
through a separate TCP socket, identified by its unique set of IP addresses and port
numbers. This allows servers to efficiently manage communications with multiple clients
concurrently.
 Unique Sockets for Web Servers: Web servers assign different sockets for each
connecting client to ensure isolated and secure communication channels. This practice
allows servers to cater to many clients at the same time, each through a dedicated
socket.
 Non-Persistent HTTP Communication: In scenarios involving non-persistent HTTP, where
connections are short-lived and terminated after each request/response cycle, each new
request from a client is processed through a different TCP socket. This is typically due to
the client using a different source port number for each connection, ensuring that each
request is treated as a separate entity, thereby enhancing the management of
concurrent requests and responses.
14) Connectionless transport: UDP
15) UDP (User Datagram Protocol) is a "no frills" or "bare bones" transport protocol in the Internet
protocol suite, known for its simplicity and efficiency in scenarios where the reliability and
ordering of data delivery are not critical. Here's why UDP exists and its characteristics:
 "Best Effort" Service: UDP provides a best-effort delivery service, meaning segments
(packets of data) may be lost or delivered out of order. There's no guarantee of delivery
or sequence.
 Connectionless: Unlike TCP, UDP does not establish a connection before sending data.
There's no handshake between sender and receiver, making the protocol simpler and
faster as it eliminates the delay caused by connection setup.
 Independent Handling of Segments: Each UDP segment is processed independently of
others. This means the protocol does not track the sequence or maintain a connection
state, allowing for a lightweight communication model.
 Use Cases: UDP is often used for streaming multimedia applications where speed is
crucial and some loss of data (like a small portion of a video or audio) can be tolerated
without significantly affecting the user experience. It's preferred in situations where the
timely delivery of data is more important than the completeness of that data.
 Why is there a UDP? • no connection establishment (which can add delay) • simple: no
connection state at sender, receiver • small segment header • no congestion control:
UDP can blast away as fast as desired.
16) UDP Checksum:
 Goal of Checksum: The primary purpose of the checksum in UDP segments is to detect
errors, such as flipped bits, that may occur during the transmission of data across a
network. This mechanism helps identify corrupted segments upon arrival.
 Checksum Calculation (Sender):
 The sender treats the content of the UDP segment as a sequence of 16-bit integers.
 It then calculates the checksum by performing a 1’s complement sum (a form of
addition) of all these 16-bit integers in the segment.
 The resulting checksum value is inserted into the UDP checksum field of the segment
before transmission.
 Checksum Verification (Receiver):
 Upon receiving a UDP segment, the receiver computes the checksum of the segment in
the same manner as the sender (treating the segment contents as 16-bit integers and
summing them up in 1’s complement arithmetic).
 The receiver then compares this computed checksum with the value in the segment's
checksum field.
 If the values do not match, an error is detected in the segment.
 If the values match, it is assumed that no error has occurred in the transmission.
However, it's important to note that the checksum process may not catch all errors;
there could be instances where errors still pass undetected due to the limitations of the
checksum algorithm.

You might also like