You are on page 1of 55

Data Communication and Computer Networks ECEg4291

Chapter FOURNetworks
Protocol Architectures
July 16, 2021
Samson.A 1
• Protocol Layers

• The OSI Model

• TCP/IP Protocol Suite

• Addressing

Ref:- Data Communications AND Networking


Chapter Two 2

BEHROUZ A. FOROUZAN
Introduction

 When computers, terminals, and/or other data processing


devices exchange data, the procedures involved can be quite
complex. There must be a set of rules between the two
entities.
 A protocol defines the rules that both the sender and
receiver and all intermediate devices need to follow to be
able to communicate effectively
 When communication is simple, we may need only one simple
protocol
 When the communication is complex, we may need to divide
the task between different layers, in which case we need a
protocol at each layer, or protocol layering.

July 16, 2021 3


Protocol Layering enables us to divide a complex task
into several smaller and simpler tasks

Examples
 A single layer protocol
 i.e. communication occur in only one layer – face-to-face

July 16, 2021 4


• A three layer protocol
o When the communication is complex, we may need to divide
the task between different layers, in which case we need a
protocol at each layer, or protocol layering.

July 16, 2021 5


Protocol Layering Advantages

 It allows us to separate the services from the implementation


 A layer needs to be able to receive a set of services from
the lower layer and to give the services to the upper layer;
we don’t care about how the layer is implemented
 Communication does not always use only two end systems.
There are intermediate systems that need only some layers,
but not all layers
 This helps not to make each intermediate system as
complex as the end systems
 Thus, the whole system will be inexpensive

July 16, 2021 7


Principles of Protocol Layering
 For bidirectional communication, each layer be able to
perform two opposite tasks, one in each direction. For
example, from our three layer protocol example, we see that
the task at each layer is to:
 Listen and talk at layer 3
 Encrypt and decrypt at layer 2
 Send and receive at layer 1

 Objects under each layer at both sites should be identical. For


example, from our three layer protocol example, the object at
both site under
 Layer 3 should be plaintext letter
 Layer 2 should be ciphertext letter
 Layer 1 should be a piece of mail
July 16, 2021 8
Logical Connections
 Logical connection between peer layers: i.e. from the
above principles we can say that, we have layer-to-layer
communication

July 16, 2021 9


Network Models
• Two models have been devised to define computer
network operation
– OSI model
– TCP/IP protocol suite
OSI Reference Model
 OSI: Open Systems Interconnection
 Developed by the International Organization for
Standardization (ISO) to cover all aspects of network
communication
 An Open system: is a set of protocols that allows any two
different systems to communicate regardless of their
underlying architecture

July 16, 2021 10


However, OSI is not a protocol by itself, instead it is a model for
understanding and designing a network architecture that is flexible,
robust, and interoperable.

The 7 layers of
OSI model

July 16, 2021 11


Interaction between layers in the OSI model

July 16, 2021 12


……
 Each layer in the sending device adds its own information
to the message it receives from the layer just above it and
passes the whole package to the layer just below it.
 At the receiving machine, the message is unwrapped layer
by layer, with each process receiving and removing the
data meant for it.
 E.g: Layer 2 removes the data meant for it, then
passes the rest to layer 3. Layer 3 then removes the
data meant for it and passes the rest to layer 4, and so
on.

July 16, 2021 13


Layer 1:- Physical
 The physical layer is responsible for the movement of individual bits
from one node to the next.
 This layer is also concerned with:
 Regulates the transmission of a stream of bits over a physical
medium.
 Defines how the cable is attached to the network adapter
 It also defines the type of the transmission medium

 Defines what encoding technique is used to send data over the


cable
 And also encoding bits into signals: electrical or optical

 Defines the data rate, transmission mode, physical topology,


synchronization bits, …

July 16, 2021 14


Layer 2:- Data Link
 It is responsible for transferring frames from one node to another,
without errors
 i.e. the data link layer makes the physical layer appear error free
to the upper layer
 Other responsibilities include:
 Framing
 Physical addressing
 Flow control
 Error control
 Access control

July 16, 2021 15


Layer 3:- Network
 This layer is responsible for the delivery of individual packets from
the source host to the destination host
 It ensures that each packet gets from its point of origin to its final
destination
 Note, however, that the data link layer oversees the delivery of
the packet between two systems on the same network
 This layer is also responsible for:
 Routing of a data
 Logical addressing
 Translates logical addresses into physical addresses

July 16, 2021 16


Layer 4:- Transport
 It is responsible for the delivery of a message from one process to
another
 Note: Network layer ensures packet delivery from source to
destination host.
 This layer also handles:
 Service point addressing
 Segmentation and reassembly
 Flow control
 Unlike, data link layer, flow control at this layer is performed

end-to-end rather than across a single link


 Error control
 Corrected through retransmission

July 16, 2021 17


Layer 5:- Session
 Session layer is responsible for dialog control and
synchronization
 This layer establishes dialog control between the two
computers in a session, regulating which side transmits, and
when and how long it transmits.
 This layer allows applications on different computers to:
 Establish
 Use and
 End a session/connection.

July 16, 2021 18


Layer 6:- Presentation
 This layer is responsible for translation, compression, and
encryption
 This is a layer:
 That converts incoming and outgoing data from one
presentation format to another (for example, from a text
stream into a popup window with the newly arrived text).
 Manages security issues by providing services such as data
encryption and compression.
 It’s sometimes called the syntax layer.

July 16, 2021 19


Layer 7: Application Layer
 This layer is responsible for providing services to the user
 This is the layer at which:-
Communication partners are identified,

 Quality of service is identified,
 User authentication and privacy are considered, and
 Any constraints on data syntax are identified.

 It represents the services that directly support applications such


as software for file transfers, database access, email, and
network games.

July 16, 2021 20


 Layer 1, 2 and 3 i.e. physical, data link, and network are network
support layers.
 Layer 4, Transport layer provides end to end reliable data
transmission.
 Layer 5, 6 and 7 i.e. Session, Presentation, and Application layer
are user support layers.

July 16, 2021 21


Summary

July 16, 2021 22


An exchange using the OSI model
Encapsulation and Decapsulation

July 16, 2021 23


TCP/IP Layers
TCP/IP Protocol
Architecture
• It is a five layer model
• Transmission Control
Protocol/Internet Protocol
 Developed by US Defense
Advanced Research Project
Agency (DARPA)
 This protocol suite comprises
a large collection of
standardized protocols

July 16, 2021 24


 Communication through an internet

July 16, 2021 25


Logical connection between layers and their duties

 As the figure shows, the duty of the application, transport, and


network layers is end-to-end.
 However, the duty of the data-link and physical layers is hop-to-hop,
in which a hop is a host or router.
 In other words, the domain of duty of the top three layers is the
Internet, and the domain of duty of the two lower layers is the link
July 16, 2021 27
 Identical objects in the TCP/IP protocol suite

July 16, 2021 28


1. Physical Layer
 The physical layer covers the physical interface between
a data transmission device (e.g., workstation, computer)
and a transmission medium or network.
 This layer is concerned with
 Specifying the characteristics of the
transmission medium,
 The nature of the signals
 The data rate, and
 Related matters

July 16, 2021 29


2. Network Access Layer (Data Link)
 This layer is concerned with the exchange of data
between an end system (server, workstation, etc.) and
the network to which it is attached
 It is concerned with issues like :
 Destination address provision
 Invoking specific services like priority
 Access to & routing data across a network link between two attached
systems
 Allows layers above to ignore link specifics
 The data-link layer is responsible for taking the datagram and moving it
across the link
 The link can be LAN/WAN
 The data-link layer takes a datagram and encapsulates it in a packet called
a frame.
 Each link-layer protocol may provide a different services. Some link-layer
protocols provide complete error detection and correction, some provide
only error correction.
July 16, 2021 30
3. Network Layer (Internet)

 The network layer is responsible for creating a connection between


the source computer and the destination computer.
 The communication at the network layer is host-to-host.
 However, since there can be several routers from the source to the
destination, the routers in the path are responsible for choosing the
best route for each packet.
 We can say that the network layer is responsible for host-to-host
communication and routing the packet through possible routes.
 Internet Protocol (IP) is used at this layer to
provide the routing function across multiple
networks.
 Implemented in end systems and routers
 Routers
July 16, 2021 connect two networks and relays data between them 31
…….
 IP also defines the format and the structure of addresses used
in this layer.
 IP is also responsible for routing a packet from its source to its
destination, which is achieved by each router forwarding the
datagram to the next router in its path.
 IP is a connectionless protocol that provides no flow control, no
error control, and no congestion control services.
 This means that if any of these services is required for an
application, the application should rely only on the transport-
layer protocol.

July 16, 2021 32


IP Header

July 16, 2021 33


IP ON PACKET
Fragmentation
 Version: 4 bits (IPv4, IPv6, …)
 HLEN: Header Length 4 bits – This is the total length of the datagram header
 The header has between 20 to 60 bytes
 If Option field has 0 byte  The header is 20 byte and HLEN = 5 x

4 = 20
 Otherwise: The header is (20 + Option (0 – 40 byte))

 The maximum header is 60 byte and HLEN = 15 x 4 = 60


 Services – 8 bits
 DS: Differentiated Service (codepoint) – 6 bits
 ECN: Explicit Congestion Notification – 2 bits

 Total Length (16 bits): Header + Data


 Identification, Flags, Fragmentation offset fields are used in fragmentation
 Time to Live
 Protocol
 Checksum
July 16, 2021 34
IP Header Checksum Example

 Here is a IP header from an IP packet received at destination :


4500 003c 1c46 4000 4006 b1e6 ac10 0a63 ac10 0a0c
Lets first map these values with the header
 ’45’ corresponds to the first two fields in the header ie  ‘4’
corresponds to the IP version and ‘5’ corresponds to the header
length. Since header length is described in 4 byte words so
actual header length comes out to be 5×4=20 bytes.
 ’00’ corresponds to TOS or the type of service. This value of TOS
indicated normal operation.
 ‘003c’ corresponds to total length field of IP header. So in this
case the total length of IP packet is 60.
 1c46’ corresponds to the identification field.
July 16, 2021 35
 ‘ ‘4000’ can be divided into two bytes. These two bytes (divided
into 3 bits and 13 bits respectively) correspond to the flags and
fragment offset of IP header fields.
 ‘4006’ can be divided into ’40’ and ’06’. The first byte ’40’
corresponds to the TTL field and the byte ’06’ corresponds to the
protocol field of the IP header. ’06’ indicates that the protocol is
TCP.
 ‘be16’ corresponds to the checksum which is set at the
source end (which sent the packet). Please note that as already
discussed this field will be set to zero while computing the
checksum at destination end.
 The next set of bytes ‘ac10’ and ‘0a0c’ correspond to the source
IP address and the destination IP address in the IP header.
July 16, 2021 36
4. Transport Layer

 The transport layer at the source host gets the message from the
application layer, encapsulates it in a transport layer packet (called
a segment or a user datagram in different protocols) and sends it,
through the logical (imaginary) connection, to the transport layer at
the destination host.
 In other words, the transport layer is responsible for giving services
to the application layer

July 16, 2021 37


Transport-layer protocols
 The transport-layer protocols in the Internet, are:
1. Transmission Control Protocol (TCP):- is a connection-oriented protocol
that first establishes a logical connection between transport layers at two
hosts before transferring data.
 It creates a logical pipe between two TCPs for transferring a stream of
bytes.
 TCP provides:
 Flow control (matching the sending data rate of the source host with
the receiving data rate of the destination host to prevent overwhelming
the destination)
 Error control (to guarantee that the segments arrive at the destination
without error and resending the corrupted ones), and
 Congestion control to reduce the loss of segments due to congestion
in the network.

July 16, 2021 38


2. User Datagram Protocol (UDP): is a connectionless protocol that
transmits user datagrams without first creating a logical connection
 In UDP, each user datagram is an independent entity without
being related to the previous or the next one (the meaning of the
term connectionless).
 UDP is a simple protocol that does not provide flow, error, or
congestion control.
 Its simplicity, which means small overhead, is attractive to an
application program that needs to send short messages and
cannot afford the retransmission of the packets involved in TCP,
when a packet is corrupted or lost.
3. Stream Control Transmission Protocol (SCTP) is designed to
respond to new applications that are emerging in the multimedia.

July 16, 2021 39


TCP & UDP Header
• TCP Header

 UDP Header

July 16, 2021 40


5. Application Layer
 Communication at the application layer is between two
processes (two programs running at this layer).
 To communicate, a process sends a request to the
other process and receives a response.
 Process-to-process communication is the duty of the
application layer.

July 16, 2021 41


Application layer protocols
 The Hypertext Transfer Protocol (HTTP) is a vehicle for
accessing the World Wide Web (WWW)
 The Simple Mail Transfer Protocol (SMTP) is the main
protocol used in electronic mail (e-mail) service
 The File Transfer Protocol (FTP) is used for transferring files
from one host to another.
 The Terminal Network (TELNET) and Secure Shell (SSH)
are used for accessing a site remotely.
 The Simple Network Management Protocol (SNMP) is used
by an administrator to manage the Internet at global and local
levels.

July 16, 2021 42


Application layer protocols…

 The Domain Name System (DNS) is used by other protocols


to find the network-layer address of a computer.
 The Internet Group Management Protocol (IGMP) is used
to collect membership in a group.

July 16, 2021 43


Encapsulation and Decapsulation
 Encapsulation

July 16, 2021 44


How the Receiving Host Handles the Packet

When the packet arrives on the receiving host,


1.Physical Network Layer receives the packet in its frame form. It computes
the CRC of the packet, then sends the frame to the data link layer.
2.Data-Link Layer verifies that the CRC for the frame is correct and strips off
the frame header and CRC. Finally, the data link protocol sends the frame to
the Internet layer.
3.Internet Layer reads information in the header to identify the transmission If
it was fragmented, IP reassembles the fragments into the original datagram. It
then strips off the IP header and passes the datagram on to transport layer
protocols.
4.Transport Layer (TCP and UDP) reads the header to determine which
application layer protocol must receive the data. Then TCP or UDP strips off
its related header and sends the message or stream up to the receiving
application.
5.Application Layer receives the message and performs the operation
requested by the sending host.
July 16, 2021 45
TCP/IP protocol suite

July 16, 2021 46


TCP/IP vs OSI

July 16, 2021 48


Addressing
 Any communication that involves two parties needs two addresses:
 Source address and
 Destination address.

 There is a relationship between the layer, the address used in that


layer, and the packet name at that layer.
 Names: at the application layer, we normally use names to define
the site that provides services, such as hu.edu.et, or the e-mail
address, such as somebody@hu.edu.et.
 At the transport layer, addresses are called port numbers, and
these define the application-layer programs at the source and
destination.
 Port numbers are local addresses that distinguish between
several programs running at the same time.

July 16, 2021 49


Addressing
 At the network-layer, the addresses are global, with the whole
Internet as the scope. A network-layer address (IP Address)
uniquely defines the connection of a device to the Internet.
 The link-layer addresses, sometimes called MAC addresses, are
locally defined addresses, each of which defines a specific host or
router in a network (LAN or WAN).

July 16, 2021 50


Addressing in the TCP/IP protocol suite

Web address,email address

HTTP 80 FTP 21 POP3 110


SMTP 25 Telnet 23

Ip address ex:- 192.168.1.110

MAC address :-07:01:02:01:2C:4B


A 6-byte (12 hexadecimal digits)
physical address.

July 16, 2021 51


July 16, 2021 52
Port Address

 A port number is a way to identify a specific process to which an


Internet or other network message is to be forwarded when it arrives
at a server. For the TCP and the UDP, a port number is a16-bit
integer that is put in the header appended to a message unit.
 For TCP, the PDU is a segment, and a datagram for UDP. Both
protocols use a header field for recording the source and
destination port number. A port number is a 16-bit unsigned integer,
thus ranging from 0 to 65535.
 Well-known ports range from 0 through 1023.
 Registered ports are 1024 to 49151.
 Dynamic ports (called private ports) are 49152 to 65535.
Examples :- HTTP 80 SMTP 25
Telnet 23 FTP 21
July 16, 2021 POP3 110 DNS 53 53
MAC Address
 Every NIC has a hardware address that's known as a MAC,
for Media Access Control. Where IP addresses are
associated with TCP/IP (networking software), MAC
addresses are linked to the hardware of network adapters.
 For example, consider a network adapter with the MAC
address "00-14-22-01-23-45." The OUI for the manufacture of
this router is the first three octets—"00-14-22." Here are the
OUI for other some well-known manufacturers.
 Dell: 00-14-22
Nortel: 00-04-DC
Cisco: 00-40-96
Belkin: 00-30-BD

July 16, 2021 Ipconfig/All you can see your pc’s Mac address54
IP Address
 An IP address, or simply an "IP," is a unique address that
identifies a device on the Internet or a local network. It allows
a system to be recognized by other systems connected via
the Internet protocol. There are two primary types of IP
addressformats used today — IPv4 and IPv6.
 IP address management. IP address management (IPAM) is
software that can plan, track, and manage the IP addresses
used in a computer network. Although IPAM is a way of
managing network addressing, it does not typically provide
Domain Name System (DNS) and Dynamic Host
Configuration Protocol (DHCP).

July 16, 2021 55


MAC vs. IP Address Relationship

 TCP/IP networks use both MAC addresses and IP addresses but for


separate purposes. A MAC address remains fixed to the device's
hardware while the IP address for that same device can be changed
depending on its TCP/IP network configuration. 
 Media Access Control operates at Layer 2 of the OSI
model while Internet Protocol operates at Layer 3. This allows MAC
addressing to support other kinds of networks besides TCP/IP.
 IP networks manage the conversion between IP and MAC
addresses using Address Resolution Protocol (ARP). The Dynamic
Host Configuration Protocol (DHCP) relies on ARP to manage the
unique assignment of IP addresses to devices.

July 16, 2021 56


July 16, 2021 57
Quizzzzzz …1 Time:-20min

1. What is the difference between the delivery of packet


in the network layer and the delivery of segment in
the transport layer ?

2. Write some functions of Data link layer, Network


Layer and Transport layer with their data type and
respective devices.

3. A channel has B = 4 kHz and a signal-to-noise ratio


of 30 dB. Determine maximum information rate for
128-level encoding.
July 16, 2021 58

You might also like