Module 5
Module 5
Syllabus
The Transport Service
Services Provided to the Upper Layers
Transport Service Primitives
Berkeley Sockets
An Example of Socket Programming: An Internet File Server
Elements of Transport Protocols
Addressing
Connection Establishment
Connection Release
Error Control and Flow Control
Multiplexing
Crash Recovery
Transport Layer
The ultimate goal of the transport layer is to provide efficient, reliable, and
cost-effective service to its users, normally processes in the application layer. To
achieve this goal, the transport layer makes use of the services provided by the
network layer. The hardware and/or software within the transport layer that
does the work is called the transport entity.
Position of transport layer
Transport Layer
Process-to-process delivery
❖To allow users to access the transport service, the transport layer must provide
some operations to application programs, that is, a transport service interface.
Each transport service has its own interface.
❖The transport service is similar to the network service, but there are also some
important differences. The main difference is that the network service is
intended to model the service offered by real networks, warts and all. Real
networks can lose packets, so the network service is generally unreliable. The
(connection-oriented) transport service, in contrast, is reliable.
❖A second difference between the network service and transport service is whom
the services are intended for. The network service is used only by the transport
entities. Few users write their own transport entities, and thus few users or
programs ever see the bare network service. In contrast, many programs see the
transport primitives. Consequently, the transport service must be convenient
and easy to use.
Transport Service Primitives
congestion control.
o QUIC:
▪ Provides enhanced performance and security, especially for
Though the transport protocols resemble the Data Link Protocols, significant
differences are present due to the major dissimilarities between the
environments in which the two protocols operate.
A physical channel exists in DLL, where as it is replaced by the entire subnet for
Transport Layer
A final difference between the data link and transport layers is one of amount
rather than of kind. Buffering and flow control are needed in both layers, but
the presence of a large and dynamically varying number of connections in the
transport layer may require a different approach than we used in the data link
layer
Addressing
• When an application process wishes to set up a connection to a remote
application process, it must specify which one to connect to. The method
normally used is to define transport addresses to which processes can
listen for connection requests. In the Internet, these end points are called
ports.
6-14, a, b
6-14, c,d
(c) Response lost. (d) Response lost and subsequent DRs lost.
Flow Control and Buffering
Multiplexing can also be useful in the transport layer for another reason.
Suppose, for example, that a subnet uses virtual circuits internally and imposes a
maximum data rate on each one. If a user needs more bandwidth than one virtual
circuit can provide, a way out is to open multiple network connections and
distribute the traffic among them on a round-robin basis, called downward
multiplexing.
UDP
• The User Datagram Protocol (UDP) is a transport layer
protocol defined for use with the IP network layer
protocol. It is defined by RFC 768 written by John Postel.
It provides a best-effort datagram service to an End
System (IP host).
• The service provided by UDP is an unreliable service that
provides no guarantees for delivery and no protection
from duplication. The simplicity of UDP reduces the
overhead from using the protocol and the services may
be adequate in many cases.
• UDP provides a minimal, unreliable, best-effort,
message-passing transport to applications and
upper-layer protocols
Introduction to UDP
The Internet protocol suite supports a connectionless transport protocol, UDP (User
Datagram Protocol).
The UDP header.
The source port is primarily needed when a reply must be sent back to the
source. The UDP length field includes the 8-byte header and the data.
UDP Checksum (A checksum to verify that the end to end data has not been
corrupted by routers or bridges in the network or by the processing in an end
system. The algorithm to compute the checksum is the Standard Internet
Checksum algorithm. This allows the receiver to verify that it was the intended
destination of the packet, because it covers the IP addresses, port numbers and
protocol number, and it verifies that the packet is not truncated or padded,
because it covers the size field. Therefore, this protects an application against
receiving corrupted payload data in place of, or in addition to, the data that was
sent. In the cases where this check is not required, the value of 0x0000 is placed
in this field, in which case the data is not checked by the receiver.
The Internet Transport Protocols: TCP
• TCP (Transmission Control Protocol) was specifically designed
to provide a reliable end-to-end byte stream over an
unreliable internetwork.
A socket may be used for multiple connections at the same time. In other
words, two or more connections may terminate at the same socket.
Connections are identified by the socket identifiers at both ends, that is,
(socket1, socket2). No virtual circuit numbers or other identifiers are used.
Port numbers below 1024 are called well-known ports and are reserved for
standard services
TCP Protocol
applicatio applicatio
n rites
w n
reads
socke socke
data data
t laye t laye
r TCP data segment TCP r
send receive
buffer ACK segment buffer
33
The TCP Service Model
• All TCP connections are full duplex and point-to-point. Full duplex
means that traffic can go in both directions at the same time.
Point-to-point means that each connection has exactly two end
points. TCP does not support multicasting or broadcasting.
TCP Header.
• The Source port and Destination port fields identify the local end
points of the connection. A port plus its host's IP address forms a
48-bit unique end point. The source and destination end points
together identify the connection.
• This connection identifier is called a 5 tuple because it consists
of five pieces of information: the protocol (TCP), source, IP and
source port, and destination IP and destination port.
• The Sequence number and Acknowledgement number fields
perform their usual functions. The latter specifies the next byte
expected, not the last byte correctly received. Both are 32 bits
long because every byte of data is numbered in a TCP stream.
• The TCP header length tells how many 32-bit words are
contained in the TCP header.
• Next comes a 4-bit field that is not used.
• CWR and ECE are used to signal congestion when ECN (Explicit
Congestion Notification) is used. ECE is set to signal an
ECN-Echo to a TCP sender to tell it to slow down when the TCP
receiver gets a congestion indication from the network. CWR
is set to signal Congestion Window Reduced from the TCP
sender to the TCP receiver so that it knows the sender has
slowed down and can stop sending the ECN-Echo.
TCP connection
management finite state
machine. The heavy solid
line is the normal path for a
client. The heavy dashed
line is the normal path for a
server. The light lines are
unusual events. Each
transition is labeled by the
event causing it and the
action resulting from it,
separated by a slash.
TCP Transmission Policy
Window probe is a packet sent by
the sender, who can send a 1-byte
segment to force the receiver to
reannounce the next byte expected
and the window size.
Delayed acknowledgements is an
optimization, where the idea is to
delay acknowledgements
and window updates for up to 500
msec in the hope of acquiring some
data on which to hitch a free ride.
The advantage of this scheme called indirect TCP, is that both connections are now
homogeneous. Timeouts on the first connection can slow the sender down, whereas
timeouts on the second one can speed it up
•
Crash Recovery
The recovery from host crashes, particularly when long-lived connections are involved,
presents significant challenges in network protocols. In the transport layer, protocols like
TCP and UDP handle network and router crashes via retransmissions.
• However, recovering from host crashes is more complex, especially for scenarios where
connections may be long-lived, such as during large file transfers.
• Problem with Host Crashes
• When a server crashes during data transmission, the server's state (such as segment
acknowledgment information) is lost.
• If the server recovers and requests clients to inform it of the status of open connections, the
client may face difficulties in deciding whether to retransmit a segment. This difficulty arises
from the fact that events like sending acknowledgments and writing data to the application
cannot happen simultaneously. Thus, when a crash happens after one event but before the
other, the client may incorrectly assume the segment was received (or might retransmit
unnecessarily), leading to missing or duplicate segments.
• For example, consider a simple stop-and-wait protocol where a client sends a file to a server.
If the server crashes after sending an acknowledgment but before writing to the application,
the client will think the segment was received and be in state S0 (no segments outstanding),
leading it to skip retransmitting the segment. If the crash occurs after the write but before the
acknowledgment is sent, the client will retransmit the segment, which could lead to a
duplicate.
Crash Recovery
• Server and Client Strategies
• There are several possible strategies for how clients and servers handle the crash
recovery:
∙ Server Strategies: The server can be programmed to either acknowledge first or
write to the application first.
∙ Client Strategies: The client can either always retransmit, never retransmit, or
conditionally retransmit based on the state (S0 or S1).
• However, these strategies often lead to failures in recovery. The client may incorrectly
decide whether to retransmit based on incomplete or erroneous information, leading
to lost or duplicate segments.
• Event Sequences and Failures
• The event sequences at the server, such as acknowledging (A), writing (W), and
crashing (C), can occur in several orders, and these sequences lead to different
recovery behaviours. Some event sequences cause the protocol to fail in specific
client-server combinations. For instance, if the server crashes after sending an
acknowledgment but before the write, and the client is programmed to always
retransmit, the client will incorrectly send a duplicate segment.
Application layer
1. Introduction
DNS — The Domain Name System
Electronic Mail
WWW
Streaming Audio and Video
1) The application layer is the highest layer in the protocol suite.
2) The application layer provides services to the user.
3) The protocols in this layer do not provide services to any other
protocol in the suite; they only receive services from the protocols
in the transport layer.
4) Two application layers assume that there is an imaginary direct
connection through which they can send and receive messages.
5) The application layer is the only layer that provides services to the
Internet user
6) The flexibility of the application layer allows new application
protocols to be easily added to the Internet.
7) Applications need their own protocols.
8) These applications are part of network protocol.
Application protocols
Standard
protocols Non-standard
protocols
(eg,. SMTP, HTTP)
Standard Application-Layer Protocols
1. There are several application-layer protocols that have been
standardized and documented by the Internet authority.
2. Each standard protocol is a pair of computer programs that interact
with the user and the transport layer to provide a specific service to
the user.
3. Two very widely-used standardized application protocols:
4. SMTP : Simple Mail Transfer Protocol is used to exchange
electronic mail.
5. HTTP : Hyper Text Transport Protocol is used to communicate
between Web browsers and Web servers.
Nonstandard Application-Layer Protocols
1. A programmer can create a nonstandard application-layer program
if they can write two programs that provide service to the user by
interacting with the transport layer.
Client-Server Paradigm
• Google
• Yahoo
• Annauniv
• Kct
Domain
• A domain is a subtree of the domain name space.
• The name of the domain is the domain name of the node at
the top of the subtree.
Distribution of Name Servers
• The information contained in the domain name space must
be stored.
• It is inefficient also unreliable[one computer store huge
information.]
Hierarchy of Name Servers
• The solution to these problems is to distribute the
information among many computers called DNS servers.
• We create many sub DNS server based on the
requirement[each divided into sub domain]
Zone and domain
• When a server dedicated for (responsible) over is called a
zone.
Root server
• A root server is a server, whose zone consists of the whole
tree.
• A root server usually does not store any information but
authority to other servers.
Primary server and secondary servers
• DNS defines two types of servers:
• A primary server -stores a file about the zone, responsible
for creating , maintaining, and updating the zone file.
• A secondary server – that transfers the complete
information about a zone from another server and store the
file on its local disk.
DNS in the Internet
• In the internet, the domain space(tree) is divided into three
different section:
• Generic domains
• Country domains
• Inverse domains
Generic domains
• It define registered hosts according to their generic
behaviour.
• WWW was constructed originally by a small group of people led by
Tim Berners Lee at CERN, in 1989 and in 1991 this was released to
the world.
1. WWW is a distributed client/server service, in which a client
(Browsers such as IE, Firefox, etc.) can access services at a server
(Web server such as IIS, Apache).
WWW –World Wide Web
1. The service provided is distributed
over many locations called sites.
2. A new protocol for the Internet and a
system of document access to use it
was proposed and named as WWW.
3. Web is a vast collection of data,
information, software and protocols ,
spread across the world in web
servers, which are accessed by client
machines by browsers through the
Internet.
• This system allows document search and retrieval from any part of the
Internet.
• The documents were having Hypertext as the content
• The units of information on the web can be referred to as pages,
documents or resources.
• A document can contain text, images, sound and video, together
called Hypermedia.
Hypermedia
COMPONENTS OF THE WEB (WWW)
Structural Components
1. Web Clients/Web Browsers
2. Web Servers – run on sophisticated hardware
3. Internet – the global infrastructure which facilitates data transfer.
Semantic Components
1. Hyper Text Transfer Protocol (HTTP)
2. Hyper Text Markup Language (HTML)
3. eXtensible Markup Language (XML)
4. Uniform Resource Identifiers (URIs)
WEB CLIENTS (BROWSERS)
1. A browser is a software on the client on the web
which initiates the communication with the server.
2. Each browser usually consists of three parts: a Browser
controller, client protocols, and interpreters.
3. The controller receives input from the keyboard or
the mouse and uses the client programs to access Client
the document. After the document has been Controller Interpreters
protocols
accessed, the controller uses one of the interpreters
to display the document on the screen.
4. Examples are Internet Explorer, Mozilla FireFox,
Netscape Navigator, Safari etc.
WEB SERVERS
1. All the communication between the web client and a web server use the
standard protocol called as HTTP.
2. Web server informs its operating system to accept incoming network
connections using a specific port on the machine.
3. The server also runs as a background process.
4. A client (browser) opens a connection to the server, sends a request,
receives information from server and closes the connection.
5. Web server monitors a communications port on its host machine, accepts
the http commands through it and performs specified operations.
6. HTTP commands include a URL specifying the host machine.
7. The URL received is translated into either a filename or a program name,
accordingly the requested file or the output of the program execution is
sent back to the browser.
Proxy Server
• A Proxy server is a computer that keeps copies of responses to recent
requests.
1. The web client sends a request to the proxy server.
2. The proxy server checks its cache.
3. If the response is not stored in the cache, the proxy server sends
the request to the corresponding server.
1. Incoming responses are sent to the proxy server and stored for
future requests from other clients.
2. The proxy server reduces the load on the original server, decreases
traffic, and improves latency.
3. However, to use the proxy server, the client must be configured to
access the proxy instead of the target server.
4. The proxy server acts as both server and client.
5. When it receives a request from a client for which it has a response,
it acts as a server and sends the response to the client.
6. When it receives a request from a client for which it does not have a
response, it first acts as a client and sends a request to the target
server.
7. When the response has been received, it acts again as a server and
sends the response to the client.
EMAIL (SMTP, MIME,
IMAP, POP)
1. One of the most popular Internet
services is electronic mail (E-mail).
2. Email is one of the oldest network
applications.
3. When the sender and the receiver
of an e-mail are on the same
system, we need only two User
Agents and no Message Transfer
Agent
4. When the sender and the receiver
of an e-mail are on different
system, we need two UA, two pairs
of MTA (client and server), and two
MAA (client and server).
EMAIL (SMTP, MIME, IMAP, POP)
The three main components of an Email are
1. User Agent (UA)
2. Message Transfer Agent (MTA) – SMTP
3. Message Access Agent (MAA) - IMAP , POP
Ali B
ce o
1. When Alice needs to send a message to Bob, she runs a UA program to
prepare the message and send it to her mail server.
2. The mail server at her site uses a queue (spool) to store messages waiting
to be sent.
3. The message, however, needs to be sent through the Internet from
Alice’s site to Bob’s site using an MTA.
4. Here two message transfer agents are needed: one client and one server.
5. The server needs to run all the time because it does not know when a
client will ask for a connection.
6. The client can be triggered by the system when there is a message in the
queue to be sent.
7. The user agent at the Bob site allows Bob to read the received message.
8. Bob later uses an MAA client to retrieve the message from an MAA server
running on the second server.
A user agent is a software
package that composes, reads,
replies to, and forwards
messages. It also handles local
mailboxes on the user
computers.
Command driven
1. Command driven user agents
belong to the early days of
electronic mail.
2. A command-driven user
agent normally accepts a one
character command from the
keyboard to perform its task.
3. Some examples of command
driven user agents are mail,
pine, and elm.
GUI-based
1. Modern user agents are
GUI-based.
2. They allow the user to interact
with the software by using both
the keyboard and the mouse.
3. They have graphical
components such as icons,
menu bars, and windows that
make the services easy to
access.
4. Some examples of GUI-based
user agents are Eudora and
Outlook.
Multipurpose Internet Mail Extension (MIME)
● Electronic mail has a simple structure. Hence, it supports messages only in NVT 7-bit ASCII
format.Therefore, it cannot be used for languages such as french, german, chinese etc. Also, it
cannot be used to send binary files or video or audio files.
● MIME is supplementary protocols that allows non-ASCII data to be sent through e-mail
MIME header
It defines five headers that can be added to the orginal e-mail header section
to define the transformation parameters:
MIME Version
● This header defines the version of MIME used.
● The current version is 1.1
● MIME-Version:1.1
Content type
● This defines type of data
used in body.
● Content type and
subtype are separated
by slash.
● Depending on subtype,
header may contain
other parameters.
● MIME allows seven
different types of data
● Content-Type:<type /subtype; parameters
Content Transfer Encoding
● It defines method used to encode the messages into 0s and 1s for
transport:
● Content-Transfer-Encoding:<type>
Difference between IMAP & POP3
IMAP POP3
2. Multiple mailboxes can be created on the 2. Only one mailbox can be created on
server. the server.
4. IMAP offers ability to search emails. 4. POP does not allow search facility.
6. Users can view the headings and sender 6. The e-mails are not downloaded
of e-mails and then decide to download. automatically.
IMAP POP3
8.IMAP requires more internet usage time. 8.POP requires less internet usage time.
9. Suitable for accessing non-mail data i.e. 9.Not suitable for accessing non-mail
attachment. data.
11. IMAP commands are not abbreviated, 11.POP commands are generally
they are full. Eg. STATUS abbreviated into codes of three or four
letters. Eg. STAT
Audio and Video Streaming
AUDIO STREAMING OVERVIEW
🖳 PC
Audio Format
LAN, Intranet,
Internet 🖳 PC
Windows Media
Streaming
.ASF
.WAV Software
Live Broadcast
Real Producer
Windows Media Encoder .RM
Real Producer 7.0
Audio Streaming Concept
• Analog-to-Digital modulation
• Streaming audio technologies relies on:
Sound sequences
Compression schemes
• Compression schemes (encoding) decreases the audio’s bandwidth
requirements:
Lowering the audio’s sampling rate
Filtering high frequencies
Performing other waveform
Audio Streaming Advantages
• RealPlayer 7
• Over 150 live radio stations built-in, superb audio
• RealProducer 7
• Streaming Software; Efficient encoding; Reach the
widest possible audience; choice of operating systems
• RealPresenter G2
• Live/recorded capability; Presentation Manager
RealSystem G2 Products & Advantages
• RealSlideshow 2
• Combine pictures with music or speech, customize the layout of presentation
• RealServer 7
• 60 simultaneous sessions of live or on-demand streaming; Near CD quality
Internet audio
• Free download at:
• http://www.realnetworks.com/products/
Video Streaming
• Video Streaming Objective
• Streaming Advantages
• Video Streaming Architecture
• Compression and Decompression-codec
• MPEG 1-4 Introduction
• Major Products and Features Comparison
Video Streaming Objective
• AVI • MPEG
• ActiveMovie • QuickTime
• Cinepak • RealVideo
• Indeo • Video for Windows
• motion-JPEG • XGA
Video Formats
AVI & ASF
• Developed by Microsoft
• AVI (Audio Video Interleaved)
- limited to 320x240 resolution
- 30 frames per second
• ASF (Advanced Streaming Format)
- Has been submitted to ISO for standardization
- Expected to replace AVI format
Codec
(Compressor/Decompressor)
• Coding techniques to compress video data
• The newest codec change their sampling rate as they run
• Choice of codec is the biggest factor to determine the bandwidth
needed to connect the server and receive content
• Many of the codecs follow international standards
Content Compression
• MPEG (A working group of ISO)
- The most common standard for video
compression and file formats
- Generally produce better quality video than other
formats
- High compression rate
- MPEG1, MPEG2 and MPEG4
MPEG-1
• RealSystem G2
http://www.realnetwork.com
Comparison
WMT –vs- RealSystem G2
• Head to head comparison
Feature Comparison
• More Information
http://www.microsoft.com/windows/windowsmedia/
Comparison
WMT –vs- RealSystem G2
• Cost Analysis
- Prepared by Approach, Inc.,
• Key findings
- Both streaming products results in positive
returns on investment
- Microsoft solution is more economical than the
RealNetwork solution
• Download in Word format
Audio Streaming Architecture
http://www.microsoft.com/windows/windowsmedia
RealSystem G2
Download RealProducer
http://www.realnetworks.com/products/producer/
Playing Audio File
http://www.microsoft.com/windows/windowsmedia/
Download RealPlayer
http://www.real.com/player/index
Real Player 7.0 Basic
Video Streaming Presentation
• Real Producer.
- C:\Program Files\REAL\RealProducer\realprod.exe
Video Streaming
• Windows Media.
- C:\Program Files\Windows Media Components\Tools\NsRex.exe
Video Streaming
• Capture Audio/Video
• Create your file
• Install the streaming software
• Windows Media Tools
http://www.microsoft.com/windows/windowsmedia/
• RealProducer 7 Basic http://www.realnetworks.com/products/
Audio/Video Streaming Summary
• RealPlayer 7 Basic
http://www.real.com/player/index