CN Unit 5
CN Unit 5
Whenever we need to deliver something to one specific destination among many, we need
an address. At the data link layer, we need a MAC address to choose one node among
several nodes if the connection is not point-to-point. A frame in the data link layer needs a
Destination MAC address for delivery and a source address for the next node's reply.
The IP addresses and port numbers play different roles in selecting the final destination of
data.
The destination IP address defines the host among the different hosts in the world.
After the host has been selected, the port number defines one of the processes on this
particular host.
IANA Ranges
The lANA (Internet Assigned Number Authority) has divided the port numbers into three
ranges: well known, registered, and dynamic (or private)
Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by lANA.
These are the well-known ports.
Registered ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by
lANA. They can only be registered with lANA to prevent duplication.
Dynamic ports. The ports ranging from 49,152 to 65,535 are neither controlled nor
registered. They can be used by any process. These are the ephemeral ports.
Socket Addresses
Process-to-process delivery needs two identifiers, IP address and the port number, at each end
to make a connection.
The combination of an IP address and a port number is called a socket address.
The client socket address defines the client process uniquely just as the server socket address
defines the server process uniquely
Multiplexing and Demultiplexing
The addressing mechanism allows multiplexing and demultiplexing by the transport layer,
Multiplexing
At the sender site, there may be several processes that need to send packets. However, there is
only one transport layer protocol at any time. This is a many-to-one relationship and requires
multiplexing.
Demultiplexing
At the receiver site, the relationship is one-to-many and requires demultiplexing. The transport layer
receives datagrams from the network layer. After error checking and dropping of the header, the transport
layer delivers each message to the appropriate process based on the port number.
Transmission Control Protocol
Well-known ports used by TCP
Figure: Stream delivery
Figure: Sending and receiving buffers
Figure: TCP segments
TCP FEATURES
Numbering System
Flow Control Note:
Error Control
Congestion Control
The bytes of data being transferred in each connection are
numbered by TCP. The numbering starts with a randomly
generated number.
SEGMENT
A packet in TCP is called a segment
• A SYN + ACK
segment cannot carry
data, but does
consume one
sequence number.
• An ACK segment,
if carrying no
data, consumes no
sequence number.
Figure: Connection establishment using three-way handshaking
Figure: Data transfer
Figure: Connection termination using three-way handshaking
Note:
Second Scenario
In the second scenario, the sender and the receiver of the e-mail are users (or application
programs) on two different systems.
The message needs to be sent over the Internet. Here we need user agents (VAs) and message
transfer agents (MTAs)
Third Scenario
In the third scenario, Bob, as in the second scenario, is directly connected to his system.
Alice, however, is separated from her system.
Either Alice is connected to the system via a point-to- point WAN, such as a dial-up modem, a DSL,
or a cable modem; or she is connected to a LAN in an organization that uses one mail server for
handling e-mails-all users need to send their messages to this mail server
Fourth Scenario
In the fourth and most common scenario, Bob is also connected to his mail server by a WAN
or a LAN.
After the message has arrived at Bob's mail server, Bob needs to retrieve it.
Here, we need another set of client/server agents, which we call message access agents
(MAAs). Bob uses an MAA client to retrieve his messages.
The client sends a request to the MAA server, which is running all the time, and requests the
transfer of the messages
Reading Messages
Replying to Messages
Forwarding Messages
Domain Name System
There are several applications in the application layer of the Internet model that follow the
client/server paradigm.
The client/server programs can be divided into two categories: those that can be directly used by
the user, such as e-mail, and those that support other application programs.
The Domain Name System (DNS) is a supporting program that is used by other programs such as
e-mail.
Need for DNS
To identify an entity, TCP/IP Protocols use the IP address, which uniquely identifies the
connection of a host to an internet.
In the case of ARPANET, a file named hosts.txt is used to list all hosts and their IP addresses, this
work suitable for small network but not for large network due to heavy load and latency.
Therefore, people prefer to use names instead of addresses that is, we need a system that can map
a name to an address and conversely an address to a name.
Thus, preferred system is called as Domain Name system.
DNS in the Internet
DNS is a protocol that can be used in different platforms. In the Internet, the domain name space
is divided into three sections.
1. Generic domains
2. Country domains and
3. Inverse domain
Hypertext Transfer Protocol (HTTP)
(HTTP) is a protocol used mainly to access data on the World Wide Web.
Request type: This field is used in the request message. In version1.1of HTTP, several request
types are defined.
Version: The most current version of HTTP is 1.1.
Status code: This field is used in the response message. The status code field is similar to those
in the FTP and the SMTP protocols. It consists of three digits.
Status phrase: This field is used in the response message. It explains the status code in text
form.
Header: The header exchanges additional information between the client and the server. For
example, the client can request that the document be sent in a special format, or the server can
send extra information about the document. The header can consist of one or more header lines.
Each header line has a header name, a colon, a space, and a header value.
Body: The body can be present in a request or response message. Usually, it contains the
document to be sent or received.