Lecture 3
Lecture 3
1
Lecture # 3: Layer Communication
Principle of communication
In order for data packets to travel from a source to a destination on
a network, it is important that all the devices on the network speak
the same language or protocol
3
Lecture #3: Layer Communication
Principle of communication
Protocols define the details of how the message is transmitted,
and delivered. This includes issues of:
Principle of communication
6
Lecture #3: Layer Communication
Concept of Layers
A network is a combination of hardware and software that sends
data from one location to another.
Hardware consists of physical equipment that carries signals
from one point of the network to another.
Software consists of instructions set that make possible the
services that we expect from the network
For example, the task of sending an e-mail from one point in the
world to another can be broken into several tasks, each performed by
a separate software package.
Each software package uses the services of another software
package.
At the lowest layer, a signal, or a set of signals, is sent from the
source computer to the destination computer. 7
Lecture #3: Layer Communication
Concept of Layers
In layered architecture of network model, one whole
network process is divided into small tasks.
Each small task is then assigned to a particular layer
which works dedicatedly to process the task only. Every
layer does only specific work.
In layered communication system, one layer of a host
deals with the task done by or to be done by its peer layer at
the same level on the remote host.
The task is either initiated by layer at the lowest level or
at the top most level.
8
Lecture #3: Layer Communication
Concept of Layers: Examples of human analogy
Let us consider two friends who communicate through postal mail
The process of sending a letter to a friend would be complex if there were
no services available from the post office
Tasks involved
in sending a letter
9
Lecture #3: Layer Communication
Concept of Layers: Examples of human analogy
Let us consider airline system
How would you find the structure to describe this complex system
that has ticketing agents, baggage checkers, gate personnel, pilots,
airplanes, air traffic control, and a worldwide system for routing
airplanes?
Horizontal layering
of airline
functionality
10
Lecture #3: Layer Communication
Concept of Layers: Protocol layering
When taken together, the protocols of the various layers are called
the protocol stack
The Internet protocol (IP) stack consists of five layers: the
physical, link, network, transport, and application layers
The Open Systems Interconnection (OSI) model consists of seven
layers
12
Lecture #3: Layer Communication
Concept of Layers: Protocol layering
• It breaks network
communication into smaller,
more manageable parts
• It standardizes network
components to allow multiple
vendor development and support
• It allows different types of
network hardware and software
to communicate with each other
• It prevents changes in one layer from affecting other layers
• It divides network communication into smaller parts to make
learning it easier to understand
14
Lecture #3: Layer Communication
OSI Model
Peer-to-Peer communication
In order for data to travel from the source to the destination,
each layer at the source must communicate with its peer layer at
the destination. This is referred to as peer-to-peer
communication
Data packets on a network originate at a source and then
travel to a destination
During this process, the protocols of each layer exchange
information, called protocol data units (PDUs).
The lower layer uses encapsulation to put the PDU from the
upper layer into its data field.
Then it adds whatever headers and trailers the layer needs to
perform its function
15
Lecture #3: Layer Communication
OSI Model
Data Encapsulation
The process of moving data
between layers of the OSI Model
Encapsulation:
Data > segment > packet > frame > bits
De-encapsulation:
Bits > frame > packet > segment > data
16
Lecture #3: Layer Communication
OSI Model
• Data Encapsulation
17
Lecture #3: Layer Communication
OSI Model
18
Lecture #3: Layer Communication
OSI Model
How data is referred?
19
Lecture #3: Layer Communication
OSI Model
Interaction between layers
Each interface
defines the
information
and services a
layer must
provide for the
layer above it.
20
Lecture #3: Layer Communication
OSI Model
22
Lecture #3: Layer Communication
OSI Model: Physical layer
The data link layer is responsible for moving frames from one hop
(node) to the next
24
Lecture #3: Layer Communication
OSI Model: Data Link layer
Other responsibilities of data link layer:
Framing: divides the stream of bits received from the network
layer into manageable data units called frames
Physical addressing: if frames are to be distributed to different
systems on the network, the data link layer adds a header to the frame
to define the sender and/or receiver of the frame
Flow control: imposes a flow control mechanism to avoid
overwhelming the receiver.
Error control: adds reliability to the physical layer by adding
mechanisms to detect and retransmit damaged or lost frames. Error
control is normally achieved through a trailer added to the end of the
frame
Access control. When two or more devices are connected to the
same link, data link layer protocols to determine which device has
control over the link at any given time. 25
Lecture #3: Layer Communication
33
Lecture #3: Layer Communication
OSI Model: Application layer
36
Lecture #3: Layer Communication
OSI Model: Summary of OSI layers
38
Lecture #3: Layer Communication
OSI Model: How data moves through OSI model
39
Lecture #3: Layer Communication
40
Lecture #3: Layer Communication
TCP/IP Model
41
Lecture #3: Layer Communication
TCP/IP Model
42
Lecture #3: Layer Communication
43
Lecture #3: Layer Communication
TCP/IP Model: Application layer
TCP/IP protocol suite combines all application related issues
into one layer.
TCP/IP has protocols to support file transfer, e-mail, and
remote login, in addition to the following:
File Transfer Protocol (FTP): reliable, connection oriented
service that uses TCP to transfer files between systems. It
supports bi-directional binary file and ASCII file transfers
Trivial File Transfer Protocol (TFTP): a connectionless
service that uses the User Datagram Protocol (UDP). TFTP is
used on the router to transfer configuration files and it is useful
in some LANs because it operates faster than FTP in a stable
environment
44
Lecture #3: Layer Communication
TCP/IP Model: Application layer
46
Lecture #3: Layer Communication
TCP/IP Model: Transport layer
TCP uses only a single type of protocol data unit, called a TCP
segment
Because one header must serve to perform all protocol
mechanisms, it is rather large, with a minimum length of 20 octets49
Lecture #3: Layer Communication
TCP/IP Model: Transport layer
TCP segment:
Source port: Number of the port that sends data
Destination port: Number of the port that receives data
Sequence number: Number used to ensure that the data
arrives in the correct order
Acknowledgment number: Next expected TCP octet
HLEN: Number of 32-bit words in the header
Reserved: Set to zero
Code bits: Control functions, such as setup and
termination of a session
Window : Number of octets that the sender will accept
50
Lecture #3: Layer Communication
TCP/IP Model: Transport layer
TCP segment:
Checksum: Calculated checksum of the header and data
fields
Urgent pointer: Indicates the end of the urgent data
Option: One option currently defined, maximum TCP
segment size
Data: Upper-layer protocol data
Code Bits or Flags (6 bits)
• URG: Urgent pointer field significant.
• ACK: Acknowledgment field significant.
• PSH: Push function.
• RST: Reset the connection.
• SYN: Synchronize the sequence numbers.
• FIN: No more data from sender 51
Lecture #3: Layer Communication
TCP/IP Model: Transport layer
UDP:User Datagram Protocol
UDP is the connectionless transport protocol in the TCP/IP
protocol stack
UDP is a simple protocol that exchanges datagrams without
guaranteed delivery.
It relies on higher-layer protocols to handle errors and
retransmit data
The following protocols use UDP: TFTP, SNMP, DHCP,
DNS
UDP datagram:
52
Lecture #3: Layer Communication
TCP/IP Model: Transport layer
53
Lecture #3: Layer Communication
TCP/IP Model: Transport layer: TCP vs UDP
TCP UDP
connection-oriented, reliable (virtual connectionless, unreliable, does not
circuit) check message delivery
Divides outgoing messages into sends “datagrams”
segments
reassembles messages at the does not reassemble incoming
destination messages
re-sends anything not received Does-not acknowledge.
provides flow control provides no flow control
more overhead than UDP (less low overhead - faster than TCP
efficient)
Examples:HTTP, NFS, SMTP Eg. VOIP,DNS,TFTP 54
Lecture #3: Layer Communication
TCP/IP Model: Internet layer
55
Lecture #3: Layer Communication
TCP/IP Model: Internet layer
58
Lecture #3: Layer Communication
• Example of Data Encapsulation TCP/IP model:
M: message, H: header 59
Lecture #3: Layer Communication
Review questions
60
Lecture #3: Layer Communication
Review questions
61