Lecture 4 Computer Networks
Lecture 4 Computer Networks
Prepared By
Dr. Ibrahim Attiya
© 2023 NMU
Ch.1: Outline
❑ Data Communications
❑ Networks
❑ Network Topology
❑ Network Types
❑ Protocol Layering
❑ TCP/IP Protocol Suite
❑ The OSI Model
❑ Internet History
Encapsulation / Decapsulation
➢ One of the important concepts in protocol layering
in the Internet is encapsulation/decapsulation.
Encapsulation at the Source Host
At the source, we have only encapsulation.
➢ At the application layer, the data to be exchanged is
referred to as a message.
▪ A message normally does not contain any header, but if
it does, we refer to the whole as the message.
▪ The message is passed to the transport layer.
➢ The transport layer takes the message as the
payload, the load that the transport layer should
take care of.
▪ It adds the transport layer header to the payload, which
contains the identifiers of the source and destination
application programs that want to communicate.
Encapsulation at the Source Host
▪ Plus, some more information needed for the end-to-
end delivery of the message, such as information
needed for flow, error control, or congestion control.
▪ The result is the transport-layer packet, which is
called the segment (in TCP) and the user datagram
(in UDP).
▪ The transport layer then passes the packet to the
network layer.
➢ The network layer takes the transport-layer packet
as data or payload and adds its own header to the
payload.
Encapsulation at the Source Host
▪ The header contains the addresses of the source and
destination hosts and some more information used for
error checking of the header, fragmentation information,
and so on.
▪ The result is the network-layer packet, called a
datagram, which is passed to the data-link layer.
➢ The data-link layer takes the network-layer packet
as data or payload and adds its own header, which
contains the link-layer addresses of the host or the
next hop (the router).
▪ The result is the link-layer packet, called a frame, which
is passed to the physical layer for transmission.
Decapsulation and Encapsulation
at Router
At the router, we have both decapsulation and
encapsulation because the router is connected
to two or more links.
➢ After the set of bits are delivered to the data-link
layer, this layer decapsulates the datagram from the
frame and passes it to the network layer.
➢ The network layer only inspects the source and
destination addresses in the datagram header and
consults its forwarding table to find the next hop to
which the datagram is to be delivered.
Decapsulation and Encapsulation
at Router
▪ The contents of the datagram should not be
changed by the network layer in the router unless
there is a need to fragment the datagram if it is too
big to be passed through the next link.
▪ The datagram is then passed to the data-link layer of
the next link.
➢ The data-link layer of the next link encapsulates
the datagram in a frame and passes it to the
physical layer for transmission.
Decapsulation at the Destination
Host
➢ At the destination host, each layer only
decapsulates the packet received, removes the
header and trailer info from the packet, and delivers
the payload to the next-higher layer protocol until
the message reaches the application layer.
➢ It is necessary to say that decapsulation in the host
involves error checking.
Addressing in the TCP/IP
Protocol Suite
➢ It is worth mentioning another concept related
to protocol layering in the Internet, addressing.
➢ Any communication that involves two parties
needs two addresses: source address and
destination address.
➢ We normally need only four pairs of addresses,
because the physical layer does not need
addresses; the unit of data exchange at the
physical layer is a bit, which definitely cannot
have an address.
Addressing in the TCP/IP
Protocol Suite
❑ MILNET
❑ CSNET
❑ NSFNET
❑ ANSNET
Internet Today
➢ Today, we witness a rapid growth both in the
infrastructure and new applications.
➢ The Internet today is a set of pier networks that
provide services to the whole world.
➢ What has made the Internet so popular is the
invention of new applications.
❑ World Wide Web
❑ Multimedia
❑ Peer-to-Peer Applications
Any Questions?