Chapter 4 Part 1
Chapter 4 Part 1
er 4
Introduction to
Protocol
Compiled By: Atinkut M. and
Dawed O.
1
Protocol
Protocols are rules and procedures for communicating.
4
Flow control
Flow control refers to techniques used to regulate the flow of
data from a source transmitter to a destination receiver.
Sometimes the source may transmit data at a faster rate than
the destination can process it, and data will be lost.
Flow control addresses this problem.
5
I. Stop-and-wait flow control
The simplest form of flow control is called stop-and-wait flow
control.
Whenever the sending computer sends a message over the
network, it starts a timer.
If no acknowledgement is received from the receiving computer
before a certain amount of time has expired it will assume that
the packet was lost, and it will retransmit it.
Otherwise, when the acknowledgement is received it will
proceed to transmit the next packet.
6
Cont.….
12
Error control
Error control refers to mechanisms that detect and correct errors
that occur in transmission.
The most common techniques for error control are based on the
following ingredients:
Error detection
Positive acknowledgement: The destination returns a positive
acknowledgement message if a packet is successfully received
and error-free.
Retransmission after timeout: The source retransmits a packet that
has not been acknowledged after a predetermined amount of
time.
Negative acknowledgement and retransmission: The destination
returns a negative acknowledgment to packets in which an error is
detected. The source retransmits such packets.
13
Cont.…
Collectively these mechanisms are all referred to as automatic
repeat request (ARQ).
The effect of ARQ is to turn an unreliable data link
into a reliable one.
ARQ provides completely reliable delivery of packets.
I. Stop-and-wait ARQ
15
Cont.…
Two types of error could occur in this technique.
If the data packet is corrupted the destination will detect the error
using an error detection technique and discard the corrupted
packet.
Whether the packet was lost or corrupted, after the
timeout interval the source will retransmit.
Second, the destination could successfully receive the data packet,
but the ACK could be lost or corrupted.
In this case no acknowledgment will be received before
the 16
timeout interval so the packet will be retransmitted.
II. Go-back-N ARQ
This form of error control is based on the sliding window
flow
control technique.
The source will send a number of frames without waiting
for acknowledgements from the destination.
The number it sends is determined by the size of the
destinations buffer.
The destination will send positive acknowledgements (RR = Receive
Ready) for successfully received packets.
These positive acknowledgements are cumulative, i.e.
an
3.
acknowledgement for packet 4 implicitly acknowledges packets 1 17
to
Cont.…
If the destination detects an error, it discards the packet and waits
for further packets to arrive.
If the destination receives an out-of-order packet it will send a
negative acknowledgement (REJ = Reject) back to the source
telling it the number of the next packet it expects to receive.
The source will then retransmit this packet together with all
subsequent packets that have been transmitted.
This technique is called go-back-N because when an error occurs
the sender has to go back a number of packets and retransmit them
all.
Figure 4 illustrates the go-back-N error control technique.
18
III. Selective-reject ARQ
Selective-reject ARQ is similar to go-back-N ARQ.
After the lost packet has been retransmitted the source resumes
transmission where it left off.
19
Cont.….
Selective-reject-ARQ would appear to be more efficient than
go-back-N ARQ but in fact it is less common.
The reason for this is that the destination must maintain a
larger buffer in order to be able to insert retransmitted packets
in their correct location.
Also, both source and destination require more
complex
processing to make the scheme work.
20
Comparison of error control techniques
21
Figure 4 – Comparison of error control techniques
Network Models
In Complex systems are better described with layered structure.
23
Cont.…
Flow control
Multiplexing
Connection setup
Routing
24
Cont.…
Two Network Models:
OSI and
TCP/IP
25
OSI model
The OSI model is divided into two layers: upper layers and
lower layers.
The upper layer of the OSI model mainly deals with the
application related issues, and they are implemented only in the
software.
The application layer is closest to the end user.
Both the end user and the application layer interact with
the software applications.
An upper layer refers to the layer just above another layer.
26
OSI model Cont…..
The lower layer of the OSI model deals with the data
transport
issues.
The data link layer and the physical layer are implemented
in
hardware and software.
The physical layer is the lowest layer of the OSI model
and is
closest to the physical medium.
The physical layer is mainly responsible for placing
27
the information on the physical medium.
The OSI reference model Cont…
28
The OSI reference model Cont…
29
OSI - a layered architecture
31
Cont.…
The lowest layers (1 and 2) define the network's physical media and
related tasks, such as putting data bits onto the NICs and cable.
The highest layers define how applications access communication
services.
The higher the layer, the more complex is its task.
33
Relationships among OSI reference model layers
Each layer provides services to the next-higher layer and shields
the upper layer from the details of how the services below it are
actually implemented.
At the same time, each layer appears to be in direct
communication with its associated layer on the other computer.
This provides a logical, or virtual, communication between the
same layers on the two computers.
In reality, actual communication between adjacent layers
takes
place on one computer only, and actual communication between
computers occurs at the physical layer only. 34
Cont.….
At each layer, software implements network functions according
to a set of protocols.
Before data is passed from one layer to another, it is
broken
down into packets.
At each OSI layer, adds additional formatting or addressing to
the packet, which is needed for the packet to be successfully
transmitted across the network.
At the receiving end, the packet passes through the layers in
reverse order.
A software module at each layer reads the information on the
35
packet, strips it away, and passes the packet up to the next layer.
Cont..
When the packet is finally passed up to the application layer,
the addressing information has been stripped away and the
packet is in its original form, which is readable by the receiver.
37
Cont.…
link and physical layers on the sending side, over the cable,
38
Layer-7: Application layer
It ensures that the data being sent is in the format that the
recipient can process.
It converts the data from sender-dependent format into a
common format and changes the common format into receiver-
dependent format at the receiving end.
42
Functions of Presentation Layer
43
Layer-5:Session layer
This layer allows two applications on different computers
to open, use, and close a connection called a session.
The Session layer is used to establish, maintain
and synchronizes the interaction between communicating
devices.
It also provides for orderly communication between devices by
regulating the flow of data.
Regulates which side transmits, plus when and how long it transmits.
Synchronization:
46
Layer-4:Transport layer
The transport layer ensures that packets are delivered error free, in
sequence, and without losses or duplications.
The main responsibility of the transport layer is to transfer the data
completely.
At the receiver side, transport layer provides services to application
layer & takes services form network layer.
At the source side, transport layer receives message from upper
layer into packets and reassembles these packets again into
message at the destination.
It is not concerned with the route the data takes to reach
47
its
destination.
The two protocols used in Transport layer
Transmission Control Protocol
It is a standard protocol that allows the
systems to
communicate over the internet.
It establishes and maintains a connection between hosts.
When data is sent over the TCP connection, then the TCP
protocol divides the data into smaller units known as segments.
Each segment travels over the internet using multiple routes,
and they arrive in different orders at the destination. The
transmission control protocol reorders the packets in the
correct order at the receiving end.
In this type of transmission the receiving devices sends an
acknowledge back to the source after a packet or group of
packet is received.
48
It is slower transmission method.
The two protocols used in Transport layer
49
Functions of Transport Layer
Segmentation of Message into packet & reassembly of packets
into message.
When the transport layer receives the message from the upper
layer, it divides the message into multiple segments, and each
segment is assigned with a sequence number that uniquely
identifies each segment. When the message has arrived at the
destination, then the transport layer reassembles the message
based on their sequence numbers.
Flow Control: Flow control facility prevents the source
form
sending data packets faster than the destination can handle. 50
Functions of Transport Layer
Error control: TL ensures that the entire message arrives at the
receiving TL without error.
52
Layer-3: Network layer
53
Functions of Network Layer
Internetworking: An internetworking is the main responsibility
of the network layer. It provides a logical connection between
different devices.
Addressing: A Network layer adds the source and destination
address to the header of the frame. Addressing is used to identify
the device on the internet.
Network addresses are assigned to local devices by network
administrator and assigned dynamically by special server
called DHCP (Dynamic Host Configuration Protocol)
54
Functions of Network Layer
This layer controls the electrical impulses that enter and leave the
add physical address to these frames & pas them to physical layer.
56
Layer-2: Data-link layer
received
57
Data-link layer contains two sub-layers:
Logical Link Control Layer
63
TCP/IP Model
The TCP/IP protocol suite was
• Troubleshooting,
Application
developed prior to the OSI model. file sharing, internet
Application
Presentation Application
Session
Transpor Transport
t Internet
Network
65
TCP/IP consists of 5 layers
PDU=The unit of communication at each Layer
3=Network IP ARP
RARP
2=Datalink Hardware oriented
• 1
68
Chapter 4
Part 2
The TCP/IP protocols
69
The TCP/IP protocols
The IP protocol and IP addresses
One of the most important protocols in the TCP/IP suite is the IP
protocol.
This is used at the Internet layer of TCP/IP (i.e. the Network
layer in the OSI model) and is used to attach network addresses
to packets.
The IP protocol provides best effort delivery between network
stations.
IP routes packets on the network by using IP addresses.
70
Cont.…
An IP address consists of 4 numbers between 0 and
255
separated by dots.
For example, 146.23.0.194 is a valid IP address.
When you surf the Internet and type a URL into your browser
(e.g. www.yahoo.com) you are actually using IP addresses.
Every Internet domain such as Yahoo or Google has at least
one IP address on the Internet.
71
Cont.…
An IP (Internet Protocol) address is a unique identifier
for a
node or host connection on an IP network.
An IP address is a 32 bit binary number usually represented as 4
The Class of the address and the subnet mask determine which
73
The Original Classful Addressing Scheme
74
The Five Network Classes
1. Class A – begins with 0
• 00000001 (110) to 01111111 (12610)*
77
IP Addresses *
Class 1st Octet Networks Ids Host IDs
Maximum Maximum
Network
Prefix bits number Suffix bits
class computers
of
networks per
network
A 7 128 24 16777216
B 14 16384 16 65536
C 21 2097152 8 256
E.g. given the IP address 128.255.10.1, we know immediately that this is
on a class B network. Because if we rewrite the address in binary form
(10000000.11111111.00001010.00000001), the first two bits are 10,
which always indicate a class B network. So the first 16 bits represent the
network ID (128.255) and the last 16 bits are the computer ID (10.1).
79
Exercise
For example, using the class-based system of IP
addressing, what can you deduce from the following IP
addresses?
i.e. What class network are they on, and what are the
network ID and computer ID?
I. 223.1.0.129
II. 2.255.15.254
III. 131.192.161.1
80
Reserved IP addresses
You cannot use every IP address. There are some addresses, or sets of
addresses, that are reserved for special uses. The table below summarises
these.
Network ID Computer Description Use
ID
All 0’s All 0’s This computer Used during system
boot
All 0’s Computer ID A computer on
this subnet
Network ID All 0’s Network number Used to refer to
an entire
subnet
All 1’s All 1’s Limited broadcast Broadcasts message
to all computers on
this
subnet
Network ID All 1’s Directed Broadcasts message to
broadcast all computers on
specified network
Reserved IP addresses……
We can see that any IP address that has a valid network ID, but all
binary 0‟s for the computer ID, is the network number.
The network number is a way of referring to an entire subnet.
Therefore this address cannot be assigned to a computer.
Similarly if the computer ID is all binary 1‟s it is a broadcast
address.
The broadcast address is used if you want to send a packet to
every computer on a subnet.
Therefore this address can also not be assigned to a computer on
the network.
82
Reserved IP addresses
For example, a class C network provides 256 different values for the
computer ID, but only 254 of these can be assigned to computers.
Most subnets have at least one router.
85
There are three IP network addresses
reserved for private networks
1. 10.0.0.0/8
2. 172.16.0.0/12
3. 192.168.0.0/16
These can be used by anyone setting up an internal
network.
Routers will never forward packets coming from these
addresses.
86
Exercise
Which of the following IP addresses are invalid addresses for
computers on the Internet? If they are invalid, explain why.
A.130.22.256.22
B.222.222.255.222
C.240.12.3.24
D.128.128.0.128
E.200.128.0.255
F.255.255.255.255
G.127.0.0.1
H.13.13.0.13
I.10.240.12.11
87
Answers
A. This address is invalid as the third number is 256 – the highest possible value is 255.
B. Valid address.
C. This address is invalid as the first number is above 223, so it is reserved and cannot be assigned to
computers.
D. Valid address.
E. This is not a valid address as the last number is 255, which represents the directed broadcast
address, and cannot be assigned to computers.
F. This is not a valid address as it represents the limited broadcast address – it will broadcast to all
computers on the subnet.
G. This is not a valid address as it represents the loopback address and cannot be assigned to
computers. This is used for troubleshooting purposes, and will send a message to the local
computer.
H. Valid address.
91
Subnetting when given a required number of networks
Example 1: A service provider has given you the Class C
network range 209.50.1.0. Your company must break the network
into 20 separate subnets.
Step 1. Determine the number of subnets and convert to binary
In this example, the binary representation of 20 = 00010100.
Step 2. Reserve required bits in subnet mask and find incremental value
The binary value of 20 subnets tells us that we need at least 5 network
bits to satisfy this requirement (since you cannot get the number 20 with
any less than 5 bits – 10100)
Our original subnet mask is 255.255.255.0 (Class C subnet)
The full binary representation of the subnet mask is as follows:
255.255.255.0 = 11111111.11111111.11111111.00000000
92
Cont…
We must “convert” 5 of the client bits (0) to network bits (1) in order
to satisfy the requirements:
New Mask = 11111111.11111111.11111111.11111000
If we convert the mask back to decimal, we now have the subnet mask
that
will be used on all the new networks – 255.255.255.248
Our increment bit is the last possible network bit, converted back to
a binary number:
New Mask = 11111111.11111111.11111111.1111(1)000 – bit with the
parenthesis is your increment bit.
If you convert this bit to a decimal number, it becomes the number
“8”
93
Cont…
Step 3) Use increment to find network ranges
Start with your given network address and add your increment to the
209.50.1.8
209.50.1.16 …etc
You can now fill in your end ranges, which is the last possible IP
209.50.1.8 – 209.50.1.15
You can then assign these ranges to your networks! Remember the first
and
last address from each range (network / broadcast IP) are unusable. 94
Exercise
Your company would like to break the Class B
private IP address range 172.16.0.0 into 60
different subnets
95
Subnetting when given a required number of clients
Example 1: A service provider has given you the Class C network
range 209.50.1.0. Your company must break the network into as many
subnets as possible as long as there are at least 50 clients per network.
Step 1. Determine the number of clients and convert to binary
In this example, the binary representation of 50 = 00110010
Step 2) Reserve required bits in subnet mask and find incremental value
The binary value of 50 clients tells us that we need at least 6 client bits to
satisfy this requirement (since you cannot get the number 50 with any
less than 6 bits – 110010)
Our original subnet mask is 255.255.255.0 (Class C subnet)
If you convert this bit to a decimal number, it becomes the number “64”. 97
Cont…
Step 3) Use increment to find network ranges
Start with your given network address and add your increment to the
99
Given an IP address & Subnet Mask, find original network
range (reverse engineering a subnet problem)
You are given the following IP address and subnet mask:
192.168.1.58
255.255.255.240
Identify the original range of addresses (the subnet) that this IP address
belongs to
When reverse engineering a problem, all you need to do is break the
subnet mask back into binary and find the increment that was used
255.255.255.240 = 11111111.11111111.11111111.11110000
Use this increment to find the network ranges until you pass the given
IP100
Cont.…
192.168.1.0
192.168.1.16
192.168.1.32
192.168.1.48
192.168.1.0 – 192.168.1.15
192.168.1.16 – 192.168.1.31
192.168.1.32 – 192.168.1.47