SlideShare ist ein Scribd-Unternehmen logo
1 von 133
Course code: COE351
Course title : Computer Networks
PART: 4
Prof. Taymoor Mohamed Nazmy
Dept. of computer science, faculty of computer science, Ain Shams uni.
Ex-vice dean of post graduate studies and research Cairo, Egypt
1
Data Link Layer
2
Data link layer
• This layer is the protocol layer that transfers data between
adjacent network nodes in a wide area network (WAN) or
between nodes on the same local area network (LAN)
segment.
• The data link layer provides the functional and procedural
means to transfer data between network entities and might
provide the means to detect and possibly correct errors that
may occur in the physical layer.
• The data link layer is concerned with local delivery of
frames between devices on the same LAN.
•
3
Communication at the data-link layer
4
OVERVIEW OF DLL
The data link layer transforms the physical layer, a raw
transmission facility, to a link responsible for node-to-node (hop-
to-hop) communication. Specific responsibilities of the data link
layer include framing, addressing, flow control, error control, and
media access control.
5
• When devices attempt to use a medium
simultaneously, frame collisions occur.
• Data-link protocols specify how devices detect
and recover from such collisions, and may
provide mechanisms to reduce or prevent them.
• A frame's header contains source and destination
addresses that indicate which device originated
the frame and which device is expected to receive
and process it.
6
• The data link thus provides data transfer across
the physical link.
• That transfer can be reliable or unreliable; many
data-link protocols do not have acknowledgments
of successful frame reception and acceptance, and
some data-link protocols might not even have any
form of checksum to check for transmission
errors.
• In those cases, higher-level protocols must
provide flow control, error checking, and
acknowledgments and retransmission.
7
8
• The data link layer has two sublayers: logical link control
(LLC) and media access control (MAC).
The data link layer sublayers
Link Layer Control (LLC)
MAC
Responsible for error
and flow control
Control
Responsible framing
and MAC address and
Multiple Access Control
9
Protocols and standardizations related to LLC and MAC
10
Possible Services Offered
1.Unacknowledged connectionless service.
2.Acknowledged connectionless service.
3.Acknowledged connection-oriented service.
11
Unacknowledged Connectionless Service
• It consists of having the source machine send
independent frames to the destination machine
without having the destination machine acknowledge
them.
• Example: Ethernet, Voice over IP, etc. in all the
communication channel were real time operation is
more important that quality of transmission.
12
Acknowledged Connectionless Service
• Each frame send by the Data Link layer is
acknowledged and the sender knows if a specific
frame has been received or lost.
• Typically the protocol uses a specific time period that
if has passed without getting acknowledgment it will
re-send the frame.
13
Acknowledged Connection Oriented Service
• Source and Destination establish a connection first.
• Each frame sent is numbered
– Data link layer guarantees that each frame sent is indeed
received.
– It guarantees that each frame is received only once and that
all frames are received in the correct order.
• Examples:
– Satellite channel communication,
– Long-distance telephone communication, etc.
14
Acknowledged Connection Oriented
Service
• Three distinct phases:
1. Connection is established by having both side
initialize variables and counters needed to keep track
of which frames have been received and which ones
have not.
2. One or more frames are transmitted.
3. Finally, the connection is released – freeing up the
variables, buffers, and other resources used to
maintain the connection.
15
Functionality of Data-link Layer
• Framing
• Data-link layer takes packets from Network Layer and
encapsulates them into Frames. Then, it sends each
frame bit-by-bit on the hardware. At receiver’ end, data
link layer picks up signals from hardware and
assembles them into frames.
• Addressing
• Data-link layer provides layer-2 hardware addressing
mechanism. Hardware address is assumed to be unique
on the link. It is encoded into hardware at the time of
manufacturing.
16
• Error Control
• Sometimes signals may have encountered
problem in transition and the bits are flipped.
These errors are detected and attempted to
recover actual data bits. It also provides error
reporting mechanism to the sender.
• Synchronization
• When data frames are sent on the link, both
machines must be synchronized in order to
transfer to take place.
17
• Flow Control
• Stations on same link may have different speed or
capacity. Data-link layer ensures flow control that
enables both machine to exchange data on same
speed.
• Multi-Access
• When host on the shared link tries to transfer the
data, it has a high probability of collision. Data-
link layer provides mechanism such as
CSMA/CD to equip capability of accessing a
shared media among multiple Systems.
18
Framing
Framing is the process of breaking the bit stream up into discrete
frames. DLL prepares a frame for transport across the local media
by encapsulating it with a header and trailer.
The data link layer frame includes:
Data: The packet from the network layer.
Header: contains control information (addressing) and located at
the beginning of frame.
Trailer: Contains control information added to the end of the
frame.
19
20
Framing
21
22
23
24
Data link control,
ARQ stop/ wait , sliding window
protocols
25
10.
Flow and Error Control
The most important responsibilities of the
data link layer are flow control and error
control. these functions are known as :
data link control.
26
Data link control.
Data must be checked and processed before
they can be used.
The rate of such processing is often slower
than the rate of transmission.
For this reason , each receiver has a buffer to
store incoming data until they are processed.
If buffer begin to fill up, the sender must slow
or halt transmission.
27
Flow Control
● One of the most important functions of data link layer.
● A technique for assuring that a transmitting station does not overwhelm
a receiving station with data.
● A set of procedures that tells the sender how much data it can transmit
before it must wait for an acknowledgement from the receiver.
● Receiver has a limited speed at which it can process incoming data and a limited
amount of memory in which to store incoming data.
● Receiver must inform the sender before the limits are reached and request that
the transmitter to send fewer frames or stop temporarily.
● Since the rate of processing is often slower than the rate of transmission,
receiver has a block of memory (buffer) for storing incoming data until they
are processed. 28
Error Control
• When data-frame is transmitted, there is a probability
that data-frame may be lost in the transit or it is received
corrupted.
• In both cases, the receiver does not receive the correct
data-frame and sender does not know anything about any
loss.
• In such case, both sender and receiver are equipped with
some protocols which helps them to detect transit errors
such as loss of data-frame.
• Hence, either the sender retransmits the data-frame or the
receiver may request to resend the previous data-frame.
29
Types of Errors
30
Single-bit error
Single bit errors are the least likely type of errors in
serial data transmission because the noise must have a
very short duration which is very rare.
However this kind of errors can happen in parallel
transmission 31
32
The term burst error means that two or
more bits in the data unit have changed
from 1 to 0 or from 0 to 1.
Burst errors does not necessarily mean that
the errors occur in consecutive bits, the
length of the burst is measured from the
first corrupted bit to the last corrupted bit.
Some bits in between may not have been
corrupted.
33
Burst error
34
35
Error Detection and Correction
• error detection :: adding enough “extra” bits
to deduce that there is an error but not enough
bits to correct the error.
• If only error detection is employed in a
network transmission  retransmission is
necessary to recover the frame (data link layer)
or the packet (network layer).
• At the data link layer, this is referred to as
ARQ (Automatic Repeat reQuest).
36
Calculate
check bits
Channel
Recalculate
check bits
Compare
Information bits Received information bits
Check
bits
Information
accepted if
check bits
match
Received
check bits
Error Detection System
Using Check Bits
Four types of redundancy checks are used
in data communications
37
Parity Check
• One extra bit is sent along with the original bits to
make number of 1s either even in case of even parity, or
odd in case of odd parity.
• The sender while creating a frame counts the number of
1s in it. For example, if even parity is used and number
of 1s is even then one bit with value 0 is added.
• This way number of 1s remains even. If the number of
1s is odd, to make it even a bit with value 1 is added.
38
• The receiver simply counts the number of 1s in a
frame. If the count of 1s is even and even parity is
used, the frame is considered to be not-corrupted
and is accepted.
• If the count of 1s is odd and odd parity is used,
the frame is still not corrupted.
• If a single bit flips in transit, the receiver can
detect it by counting the number of 1s.
• But when more than one bits are erroneous, then
it is very hard for the receiver to detect the error.
39
Even and odd Parity Check
In EP Even zero put zero, in OP odd zeros put zero
40
41
Error Detection Methods
• Vertical Redundancy Check (VRC)
– Append a single bit at the end of data block such that
the number of ones is even
–
 Even Parity (odd parity is similar)
0110011  01100110
0110001  01100011
– VRC is also known as Parity Check
– Performance:
• Detects all odd-number errors in a data block
42
Error Detection Methods
• Longitudinal Redundancy Check (LRC)
– Organize data into a table and create a parity for
each column
11100111 11011101 00111001 10101001
11100111
11011101
00111001
10101001
10101010
11100111 11011101 00111001 10101001 10101010
Original Data LRC
43
1 0 0 1 0 0
0 1 0 0 0 1
1 0 0 1 0 0
1 1 0 1 1 0
1 0 0 1 1 1
Bottom row consists of
check bit for each column
Last column consists of
check bits for each row
Two-dimensional
Parity Check Code
odd parity for check bits column
And row
Even parity
Even parity
44
1 0 0 1 0 0
0 0 0 0 0 1
1 0 0 1 0 0
1 1 0 1 1 0
1 0 0 1 1 1
1 0 0 1 0 0
0 0 0 0 0 1
1 0 0 1 0 0
1 0 0 1 1 0
1 0 0 1 1 1
1 0 0 1 0 0
0 0 0 1 0 1
1 0 0 1 0 0
1 0 0 1 1 0
1 0 0 1 1 1
1 0 0 1 0 0
0 0 0 1 0 1
1 0 0 1 0 0
1 0 0 0 1 0
1 0 0 1 1 1
Two
errors
One
error
Three
errors
Four
errors
Arrows indicate failed check bits
Use even parity
45
Automatic Repeat Request(ARQ)
• The ARQ is error control technique..
• In this technique, if the data transmitted by the sender arrives at the
receiver without any problem, then the receiver reverts by sending
an acknowledgment(ACK).
• On the contrary to this, if the data to be transmitted gets lost or
corrupted in between then the receiver sends a negative
acknowledgment(NAK).
• Consequently, the sender retransmit the same data again.
• There is also provision of the timer with the sender so that if ACK
gets lost on the way, then the sender can again retransmit the same
data again.
46
47
 It is the simplest flow and error control
mechanism . A transmitter sends a frame
then stops and waits for an
acknowledgment.
 Stop-and-Wait ARQ has the following
features:
The sending device keeps a copy of the
sent frame transmitted until it receives an
acknowledgment( ACK)
Stop-and-Wait ARQ
48
The sender starts a timer when it sends a
frame. If an ACK is not received within an
allocated time period, the sender resends it
Both frames and acknowledgment (ACK)
are numbered alternately 0 and 1( two
sequence number only)
This numbering allows for identification of
frames in case of duplicate transmission
49
 The acknowledgment number defines the
number of next expected frame. (frame 0
received ACK 1 is sent)
 If the receiver detects an error in the received
frame, or receives a frame out of order it simply
discards the frame
 The receiver send only positive ACK for frames
received safe; it is silent about the frames
damage or lost.
Stop-and-Wait ARQ
50
 The receiver send only positive ACK for
frames received safe; it is silent about the
frames damage or lost.
 The sender has a control variable S that holds
the number of most recently sent frame (0 or
1). The receiver has control variable R, that
holds the number of the next frame expected
(0,or 1)
51
Normal operation
 The sender will not
send the next frame
until it is sure that
the current one is
correctly receive
 sequence number is
necessary to check
for duplicated
frames
Stop-and-Wait ARQ
52
1. Stop and Wait ARQ
2. Lost or damaged frame or ACK
 A damage or lost frame
treated by the same
manner by the receiver.
 No NACK when frame is
corrupted / duplicate
53
Sliding Window Protocol
• Sliding window algorithms are a method of flow control
for network data transfers.
• Data Link Layer uses a sliding window algorithm, which
allows a sender to have more than one unacknowledged
packet "in flight" at a time, which improves network
throughput.
• The sliding window ARQ technique has two
• two categories, namely,
• 1. Go-Back –N
• 2. Selective Repeat
54
• Both the sender and receiver maintain a finite
size buffer to hold outgoing and incoming
packets from the other side.
• • Every packet sent by the sender, must be
acknowledged by the receiver.
• The sender maintains a timer for every packet
sent, and any packet unacknowledged in a
certain time, is resent.
55
• The sender may send a whole window of packets
before receiving an acknowledgement for the first
packet in the window.
• This results in higher transfer rates, as the sender
may send multiple packets without waiting for
each packet's acknowledgement.
• The Receiver advertises a window size that tells
the sender how much data it can receive, in order
for the sender not to fill up the receivers buffers
56
57
MAC Protocols,
CSMA ,CSMA/CD
58
Multiple Access
 Problem: When two or more nodes transmit at the same time,
their frames will collide and the link bandwidth is wasted during
collision
 How to coordinate the access of multiple sending/receiving
nodes to the shared link???
 Solution: We need a protocol to coordinate the transmission of the
active nodes
 These protocols are called Medium or Multiple Access Control
(MAC) Protocols belong to a sublayer of the data link layer
called MAC (Medium Access Control)
59
• What is expected from Multiple Access Protocols:
– Main task is to minimize collisions in order to
utilize the bandwidth by:
• Determining when a station can use the link
(medium)
• what a station should do when the link is busy
• what the station should do when it is involved
in collision
60
MAC
• The media access control (MAC) data
communication protocol sub-layer.
• It provides addressing and channel access
control mechanisms that make it possible for
several terminals or network nodes to
communicate within a multiple access network
that incorporates a shared medium, e.g.
Ethernet.
61
• The hardware that implements the MAC is
referred to as a medium access controller.
• The MAC sub-layer acts as an interface between
the logical link control (LLC) sublayer and the
network's physical layer.
• The MAC layer emulates a full-duplex logical
communication channel in a multi-point network.
• This channel may provide unicast, multicast or
broadcast communication service.
62
Taxonomy of multiple-access protocols
63
Random Access Protocols
• when node has packet to send
– transmit at full channel data rate R (generally no pieces)
– NO a priori allocation of channel among nodes
• two or more transmitting nodes on channel ➜ “collision”
• random access MAC protocol specifies:
– how to detect collisions
– how to recover from collisions (e.g., via delayed retransmissions)
• examples of random access MAC protocols:
– slotted ALOHA
– ALOHA
– CSMA, CSMA/CD, CSMA/CA
64
64
65
Aloha – Basic Technique
• Basic idea:
– When you’re ready, transmit
– Receiver’s send ACK for data
– Detect collisions by timing out for ACK
– Recover from collision by trying after random delay
66
Slotted Aloha
• Time is divided into equal size slots (= pkt trans. time)
• Node (w/ packet) transmits at beginning of next slot
• If collision: retransmit pkt in future slots with probability p,
until successful
Success (S), Collision (C), Empty (E) slots
Ethernet
• Ethernet, sometimes simply called LAN, is a
family of protocols used in wired LANs,
described by a set of standards together
called IEEE 802.3 published by the Institute of
Electrical and Electronics Engineers.
67
The Basic operation of Ethernet Bus
This is a coax based Ethernet network where all
machines are chained using RG58 coaxial
cable (sometimes referred to as Thin Ethernet or Thin-
net).
68
• Machine 2 wants to send a message to machine 4,
but first it 'listens' to make sure no one else is
using the network.
• If it is all clear it starts to transmit its data on to
the network (represented by the yellow flashing
screens).
• Each packet of data contains the destination
address, the senders address, and of course the
data to be transmitted.
69
• The signal moves down the cable and is
received by every machine on the network but
because it is only addressed to number 4, the
other machines ignore it.
• Machine 4 then sends a message back to
number 2 acknowledging receipt of the data
(represented by the purple flashing screens)
70
Collision
• What happens when two machines try to transmit at the same
time? a collision occurs.
• The resulting collision destroys both signals .
71
of its own
72
Ethernet and CSMA/CD
• Ethernet uses a protocol called CSMA/CD, this
stands for Carrier Sense, Multiple Access with
Collision Detection. To understand what this
means lets separate the three parts:
• Carrier Sense - When a device connected to an
Ethernet network wants to send data it first
checks to make sure it has a carrier on which to
send its data (usually a piece of copper cable
connected to a hub or another machine).
73
• Multiple Access - This means that all machines
on the network are free to use the network
whenever they like so long as no one else is
transmitting.
• Collision Detection - A means of ensuring that
when two machines start to transmit data
simultaneously, that the resultant corrupted data is
discarded, and re-transmissions are generated at
differing time intervals
74
Carrier Sense multiple access (CSMA)
• CSMA: listen before transmit, i.e., don’t interrupt others, wait
until there is a pause:
– if channel sensed empty : transmit entire frame
– if channel sensed busy, defer transmission
• When channel sensed empty: collisions can still occur:
– propagation delay means two nodes may not hear each other’s transmission
and the collision occurs in mid transmission
• When channel sensed busy: collisions can still occur:
– deferred nodes all detect pause at the same time after a transmission is
completed and will attempt to transmit
• Collision: entire packet transmission time wasted
– distance & propagation delay play role in in determining collision probability
7575
CSMA with Collision Detection (CSMA/CD)
• CSMA/CD: carrier sensing, deferral as in CSMA
 collisions detected within short time (propagation delay)
 colliding transmissions aborted and a jam signal transmitted, reducing channel
wastage
• collision detection:
 easy in wired LANs: measure signal strengths, compare transmitted and
received signals
– difficult in wireless LANs: received signal strength overwhelmed by local
transmission strength – detection not functional --> don’t use /CD. Use
Collision Avoidance (CA). Small reservation packets used to request channel
usage. Possible because of centralized architecture (Access Point (AP).
76
76
CSMA with Collision Detection (CSMA/CD)
1. NIC receives datagram from network layer, creates frame
2. If NIC senses channel empty, starts frame transmission. If NIC
senses channel busy, waits for pause, then checks if channel idle. If
YES transmits, if NO, repeats - waits for next pause.
3. If NIC transmits entire frame without detecting another
transmission, NIC is done with frame!
4. If NIC detects another transmission while transmitting, aborts
and sends jam signal
5. NIC waits specific time, then it returns to Step 2
7777
Collision Domain
• Network region in which collisions
are propagated.
• Repeaters and hubs propagate
collisions.
• Bridges, switches and routers do not.
Collision frequency can be kept low by
breaking the network into segments
bounded by:
– Bridges, switches, routers
78
79
80
81
82
83
84
Address Resolution Protocol
ARP
ARP Purpose
 Sending node needs a way to find the MAC address of
the destination for a given Ethernet link
The ARP protocol provides two basic functions:
 Resolving IPv4 addresses to MAC addresses
 Maintaining a table of mappings
85
ARP Functions/Operation
ARP Table
 Used to find the data link layer address that is mapped to the destination IPv4 address.
 As a node receives frames from the media, it records the source IP and MAC address
as a mapping in the ARP table.
ARP Request
 Layer 2 broadcast to all devices on the Ethernet LAN.
 The node that matches the IP address in the broadcast will reply.
 If no device responds to the ARP request, the packet is dropped because a frame
cannot be created.
86
ARP Operation
87
ARP Operation (cont.)
88
ARP Operation (cont.)
89
ARP
ARP Operation (cont.)
90
ARP
ARP Functions/Operation (cont.)
91
92
Channel Partitioning MAC protocols
TDMA: time division multiple access
Frequency
time
Frequency
time
FDMA: frequency division multiple access
CDMA: code division multiple access
 Same frequency and time but different codes.
4 users
Example:
92
Multiplexing
• Multiplexing : dividing link bandwidth into “shares”
– frequency division or -time division
•
frequency
time
frequency
time
4 users
93
Time Division Multiplexing
• In TDM digital signals are divided in frames,
equivalent to time slot i.e. frame of an optimal
size which can be transmitted in given time
slot.
• TDM works in synchronized mode. Both ends,
i.e. Multiplexer and De-multiplexer are timely
synchronized and both switch to next channel
simultaneously.
94
• When channel A transmits its frame at one end,
the De-multiplexer provides media to channel A
on the other end. As soon as the channel A’s time
slot expires, this side switches to channel B.
• On the other end, the De-multiplexer works in a
synchronized manner and provides media to
channel B. Signals from different channels travel
the path in interleaved manner. 95
Frequency Division Multiplexing
• In Frequency Division Multiplexing, Data
Streams are carried simultaneously on the
same Transmission medium by allocating to
each of them a different Frequency Band
within the Bandwidth of the Single Channel.
frequency
time
4 users
96
Wireless, LAN standards & Devices:
Ethernet and IEEE standards for LANs
97
98
Classification of Wireless Networks
• Base Station :: all communication through an
Access Point (AP) {note hub topology}. Other
nodes can be fixed or mobile.
• Infrastructure Wireless :: AP is connected to the
wired Internet.
• Ad Hoc Wireless :: wireless nodes communicate
directly with one another.
• MANETs (Mobile Ad Hoc Networks) :: ad hoc
nodes are mobile.
98
Wireless Networks
(a) Wireless networking with a base station.
(b) Ad hoc networking. 99
IEEE 802
• IEEE 802 is a family of IEEE standards dealing with local area
networks and metropolitan area networks. The complete IEEE
802 protocol suite provides a diverse set of networking
capabilities.
• For example, MAC bridging (IEEE 802.1D) deals with the
routing of Ethernet packets using a Spanning Tree
Protocol. IEEE 802.1Q describes VLANs, and IEEE
802.1X defines a port-based Network Access Control protocol,
which forms the basis for the authentication mechanisms used in
VLANs (but it is also found in WLANs) – it is what the home
user sees when the user has to enter a "wireless access key"
100
Standards Organizations
Institute of Electrical and Electronics Engineers IEEE
 38 societies
 130 journals
 1,300 conferences
 each year
 1,300 standards and
 projects
 400,000 members
 160 countries
 IEEE 802.3
 IEEE 802.11
101
102
Ethernet Standards
• Standardization
– Institute of Electrical and Electronics Engineering
(IEEE)
• 802 LAN/MAN Standards Committee (802 Committee)
creates LAN standards
– 802.3 Working Group creates Ethernet standards
– So Ethernet standards are also known as 802.3
standards.
103
Ethernet evolution through four generations
103
104
105
106
Ethernet Standards
• Ethernet
– Ethernet standards dominate in small LANs
– Governs switches
– Governs wiring
– Governs stations (network interface cards)
107
Elements of a Small Ethernet PC Network
Access Router
A1-44-D5-1F-AA-4C
D4-47-55-C4-B6-9F
To the internet
Ethernet Switch
or Hub
B2-CD-13-5B-E4-65
C3-2D-55-3B-A9-4F
UTP
UTP
UTP
UTP
UTP
Broadband
Modem
Client Client
Server
Server
108
Typical 802.11 Wireless LAN
Operation with Access Points
Switch
Client PC
Server
Large Wired LAN
Access
Point A
UTP Radio Link
Notebook
109
Typical 802.11 Wireless LAN
Operation with Access Points
• The Wireless Station sends an 802.11 frame to a server via
the access point
• The access point is a bridge that converts the 802.11 frame
into an 802.3 Ethernet frame and sends the frame to the
server
Mobile
Station
Access
Point
Ethernet
Switch
Server
802.11
Frame
802.3
Frame
110
Typical 802.11 Wireless LAN
Operation with Access Points
• The server responds, sending an 802.3 frame to the access
point
• The access point converts the 802.3 frame into an 802.11
frame and sends the frame to the mobile station.
Mobile
Station
Access
Point
Ethernet
Switch
Server
802.11
Frame
802.3
Frame
LAN (Interconnection) devices:
Repeaters, Hubs, Bridges , Switches
and Routers,
111
Hardware, Software and Networks
Peripherals (device)
• Network Interface Card (NIC)
• Repeater
• Hub
• Bridge
• Routers
• Switch
112
113
Repeater
• A physical layer device the acts on bits not on frames or packets
• Can have two or more interfaces When a bit (0,1) arrives, the
repeater receives it and regenerates it, the transmits it onto all other
interfaces
– Used to boost the signal between two cable segments or wireless
access points.
– Can not connect different network architecture.
– It amplify the signal,
114
Hardware, Software and Networks Peripherals (cont.)
Repeaters
115
Network Hardware
• Hub
– An unintelligent network device that sends one signal to all of
the stations connected to it.
• Acts on the physical layer Operate on bits rather than frames. Also called
multiport repeater. Used to connect stations adapters in a physical star
topology but logically bus.
• Connection to the hub consists of two pairs of twisted pair wire one for
transmission and the other for receiving.
• Hub receives a bit from an adapter and sends it to all the other adapters
without implementing any access method.
116
Hubs
117
118
Hub Operation
D4-47-55-C4-B6-9F
UTP
UTP
UTP
UTP
Station
A1-44-D5-1F-AA-4C
Transmits a bit.
Hub broadcasts the bit
out all ports.
A1-44-D5-1F-AA-4C B2-CD-13-5B-E4-65
C3-2D-55-3B-A9-4F
Ethernet Hub
119
Waiting to Transmit with a Hub
UTP
UTP
UTP
UTP
Station
A1-44-D5-1F-AA-4C
is transmitting.
Station
B2-CD-13-5B-E4-65
wishes to transmit.
It must wait.
A1-44-D5-1F-AA-4C
Transmitting
B2-CD-13-5B-E4-65
Waiting
C3-2D-55-3B-A9-4F
Ethernet Hub
D4-47-55-C4-B6-9F
Switch
• A switch is a network interconnection device (with multiple interfaces)
that accepts a frame from an interface and forwards the frame to the
interface corresponding to the MAC destination address in the frame.
• A switch:
• Operates on frames.
• Understands MAC addresses.
 Switches allow separate pairs of computers to communicate at the same
time.
 Switches can be used in heavily loaded networks to isolate data flow and
improve performance.
120
121
Switch Operation
UTP
UTP
UTP
UTP
Ethernet Switch
C3-2D-55-3B-A9-4F
On Switch Port 15
D4-47-55-C4-B6-9F
On Switch Port 16
A switch sends a frame
out a single port—
the one to the receiver
A1-44-D5-1F-AA-4C
On Switch Port 10
B2-CD-13-5B-E4-65
On Switch Port 13
Frame
Frame
122
Switch Operation with Multiple
Simultaneous Conversations
UTP
UTP
UTP
UTP
Ethernet Switch
C3-2D-55-3B-A9-4F
On Switch Port 15
D4-47-55-C4-B6-9F
On Switch Port 16
Multiple simultaneous
conversations are possible
A1-44-D5-1F-AA-4C
On Switch Port 10
B2-CD-13-5B-E4-65
On Switch Port 13
123
Ethernet Switching Table
Switching Table
PortStation
10 A1-44-D5-1F-AA-4C
13 B2-CD-13-5B-E4-65
15 C3-2D-55-3B-A9-4F
16 D4-47-55-C4-B6-9F
Ethernet Switch
UTP
UTP
UTP
UTP
A1-44-D5-1F-AA-4C B2-CD-13-5B-E4-65
C3-2D-55-3B-A9-4F
D4-47-55-C4-B6-9F
15 C3-2D-55-3B-A9-4F
On Port 10 On Port 13
On Port 15
On Port 16
Frame
Frame
Switch
124
Network Hardware
• Bridge
– A bridge is a network interconnection device
(with only two interfaces) that forwards frames
coming in from an interface to the outgoing
interface corresponding to the MAC destination
address in the frame
– bridge is used to connect two local-area
networks (LANs) of the same type.
125
Bridges
126
Router
• A router is a network interconnection device that accepts an IP
datagram from an incoming port and forwards the datagram to the
outgoing link that corresponds to the IP destination address in the
frame.
• The router Forwards data depending on IP addresses, not Hardware
(MAC) addresses. Isolates each LAN into a separate subnet, with
separate IP addresses.
• Can route between different LAN technologies..
– Routers are the only one of these four devices that will allow you
to share a single IP address among multiple network clients.
127
Examples of network devices connections
128
129
130
131
132
End of part 4
End of the course
133

Weitere ähnliche Inhalte

Was ist angesagt?

Data Link Control Protocols
Data Link Control ProtocolsData Link Control Protocols
Data Link Control Protocols
TechiNerd
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over Wireless
Farooq Khan
 
12 ipt 0301 Characteristics of a communication system
12 ipt 0301   Characteristics of a communication system12 ipt 0301   Characteristics of a communication system
12 ipt 0301 Characteristics of a communication system
ctedds
 

Was ist angesagt? (20)

Data link control & protocol concepts
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol concepts
 
Data Link Control Protocols
Data Link Control ProtocolsData Link Control Protocols
Data Link Control Protocols
 
Network Fundamentals: Ch4 - Transport Layer
Network Fundamentals: Ch4 - Transport LayerNetwork Fundamentals: Ch4 - Transport Layer
Network Fundamentals: Ch4 - Transport Layer
 
Transport Layer In Computer Network
Transport Layer In Computer NetworkTransport Layer In Computer Network
Transport Layer In Computer Network
 
Data link layer
Data link layerData link layer
Data link layer
 
Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocal
 
ITFT_Data Link Layer issues
ITFT_Data Link Layer  issuesITFT_Data Link Layer  issues
ITFT_Data Link Layer issues
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over Wireless
 
Switching
SwitchingSwitching
Switching
 
Data link layer
Data link layerData link layer
Data link layer
 
ELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOL
 
computer network-unit 2
computer network-unit 2computer network-unit 2
computer network-unit 2
 
12 ipt 0301 Characteristics of a communication system
12 ipt 0301   Characteristics of a communication system12 ipt 0301   Characteristics of a communication system
12 ipt 0301 Characteristics of a communication system
 
Wireless LAN in Data Communication & Networking
Wireless LAN in Data Communication & NetworkingWireless LAN in Data Communication & Networking
Wireless LAN in Data Communication & Networking
 
Network layer - design Issues
Network layer - design IssuesNetwork layer - design Issues
Network layer - design Issues
 
Chapter3
Chapter3Chapter3
Chapter3
 
Data link layer elementry protocols
Data link layer elementry protocolsData link layer elementry protocols
Data link layer elementry protocols
 
Tcp Reliability Flow Control
Tcp Reliability Flow ControlTcp Reliability Flow Control
Tcp Reliability Flow Control
 
Pause frames an overview
Pause frames an overviewPause frames an overview
Pause frames an overview
 
Unit 4
Unit 4Unit 4
Unit 4
 

Ähnlich wie Computer network coe351- part4- final

Report on data link layer
Report on data link layerReport on data link layer
Report on data link layer
Alisha Korpal
 
Osi model
Osi model Osi model
Osi model
maha tce
 
Module 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfModule 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdf
Shivakrishnan18
 

Ähnlich wie Computer network coe351- part4- final (20)

Dcn ppt by roma
Dcn ppt by romaDcn ppt by roma
Dcn ppt by roma
 
COMPUTER NETWORKS UNIT 2
COMPUTER NETWORKS UNIT 2COMPUTER NETWORKS UNIT 2
COMPUTER NETWORKS UNIT 2
 
Data communication network ppt_Unit_4.pptx
Data communication network ppt_Unit_4.pptxData communication network ppt_Unit_4.pptx
Data communication network ppt_Unit_4.pptx
 
Data link layer
Data link layerData link layer
Data link layer
 
Unit 2 ppt 3.ppt
Unit 2 ppt 3.pptUnit 2 ppt 3.ppt
Unit 2 ppt 3.ppt
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdf
 
Report on data link layer
Report on data link layerReport on data link layer
Report on data link layer
 
Introduction to data link layer
Introduction to data link layerIntroduction to data link layer
Introduction to data link layer
 
Ch6.ppt
Ch6.pptCh6.ppt
Ch6.ppt
 
DATA LINK LAYER.pdf
DATA LINK LAYER.pdfDATA LINK LAYER.pdf
DATA LINK LAYER.pdf
 
Osi model
Osi model Osi model
Osi model
 
data link layer - Chapter 3
data link layer - Chapter 3data link layer - Chapter 3
data link layer - Chapter 3
 
Nigga.pdf
Nigga.pdfNigga.pdf
Nigga.pdf
 
Computers network Chapter 3 The data link layer.ppt
Computers network Chapter 3 The data link layer.pptComputers network Chapter 3 The data link layer.ppt
Computers network Chapter 3 The data link layer.ppt
 
Data link layer
Data link layerData link layer
Data link layer
 
Error detection techniques
Error detection techniquesError detection techniques
Error detection techniques
 
Module 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfModule 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdf
 
Unit 2
Unit 2Unit 2
Unit 2
 
DLL
DLLDLL
DLL
 
Computer Network-Data Link Layer-Module-2.pdf
Computer Network-Data Link Layer-Module-2.pdfComputer Network-Data Link Layer-Module-2.pdf
Computer Network-Data Link Layer-Module-2.pdf
 

Mehr von Taymoor Nazmy

Mehr von Taymoor Nazmy (20)

Cognitive systems
Cognitive  systemsCognitive  systems
Cognitive systems
 
Cognitive systems
Cognitive  systemsCognitive  systems
Cognitive systems
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logic
 
Artificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchArtificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-search
 
Lec 2-agents
Lec 2-agentsLec 2-agents
Lec 2-agents
 
Artificial intelligent Lec 1-ai-introduction-
Artificial intelligent Lec 1-ai-introduction-Artificial intelligent Lec 1-ai-introduction-
Artificial intelligent Lec 1-ai-introduction-
 
Image processing 2
Image processing 2Image processing 2
Image processing 2
 
Image processing 1-lectures
Image processing  1-lecturesImage processing  1-lectures
Image processing 1-lectures
 
Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--
 
Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Software Engineering Lec 8-design-
Software Engineering Lec 8-design-
 
Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-
 
Software Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-iSoftware Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-i
 
Software Engineering Lec 4-requirments
Software Engineering Lec 4-requirmentsSoftware Engineering Lec 4-requirments
Software Engineering Lec 4-requirments
 
Software Engineering Lec 3-project managment
Software Engineering Lec 3-project managmentSoftware Engineering Lec 3-project managment
Software Engineering Lec 3-project managment
 
Software Engineering Lec 2
Software Engineering Lec 2Software Engineering Lec 2
Software Engineering Lec 2
 
Software Engineering Lec 1-introduction
Software Engineering Lec 1-introductionSoftware Engineering Lec 1-introduction
Software Engineering Lec 1-introduction
 
Lec 6-
Lec 6-Lec 6-
Lec 6-
 
presentation skill
presentation skillpresentation skill
presentation skill
 
Lec 4
Lec 4Lec 4
Lec 4
 
Lec 3
Lec 3Lec 3
Lec 3
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

Computer network coe351- part4- final

  • 1. Course code: COE351 Course title : Computer Networks PART: 4 Prof. Taymoor Mohamed Nazmy Dept. of computer science, faculty of computer science, Ain Shams uni. Ex-vice dean of post graduate studies and research Cairo, Egypt 1
  • 3. Data link layer • This layer is the protocol layer that transfers data between adjacent network nodes in a wide area network (WAN) or between nodes on the same local area network (LAN) segment. • The data link layer provides the functional and procedural means to transfer data between network entities and might provide the means to detect and possibly correct errors that may occur in the physical layer. • The data link layer is concerned with local delivery of frames between devices on the same LAN. • 3
  • 4. Communication at the data-link layer 4
  • 5. OVERVIEW OF DLL The data link layer transforms the physical layer, a raw transmission facility, to a link responsible for node-to-node (hop- to-hop) communication. Specific responsibilities of the data link layer include framing, addressing, flow control, error control, and media access control. 5
  • 6. • When devices attempt to use a medium simultaneously, frame collisions occur. • Data-link protocols specify how devices detect and recover from such collisions, and may provide mechanisms to reduce or prevent them. • A frame's header contains source and destination addresses that indicate which device originated the frame and which device is expected to receive and process it. 6
  • 7. • The data link thus provides data transfer across the physical link. • That transfer can be reliable or unreliable; many data-link protocols do not have acknowledgments of successful frame reception and acceptance, and some data-link protocols might not even have any form of checksum to check for transmission errors. • In those cases, higher-level protocols must provide flow control, error checking, and acknowledgments and retransmission. 7
  • 8. 8
  • 9. • The data link layer has two sublayers: logical link control (LLC) and media access control (MAC). The data link layer sublayers Link Layer Control (LLC) MAC Responsible for error and flow control Control Responsible framing and MAC address and Multiple Access Control 9
  • 10. Protocols and standardizations related to LLC and MAC 10
  • 11. Possible Services Offered 1.Unacknowledged connectionless service. 2.Acknowledged connectionless service. 3.Acknowledged connection-oriented service. 11
  • 12. Unacknowledged Connectionless Service • It consists of having the source machine send independent frames to the destination machine without having the destination machine acknowledge them. • Example: Ethernet, Voice over IP, etc. in all the communication channel were real time operation is more important that quality of transmission. 12
  • 13. Acknowledged Connectionless Service • Each frame send by the Data Link layer is acknowledged and the sender knows if a specific frame has been received or lost. • Typically the protocol uses a specific time period that if has passed without getting acknowledgment it will re-send the frame. 13
  • 14. Acknowledged Connection Oriented Service • Source and Destination establish a connection first. • Each frame sent is numbered – Data link layer guarantees that each frame sent is indeed received. – It guarantees that each frame is received only once and that all frames are received in the correct order. • Examples: – Satellite channel communication, – Long-distance telephone communication, etc. 14
  • 15. Acknowledged Connection Oriented Service • Three distinct phases: 1. Connection is established by having both side initialize variables and counters needed to keep track of which frames have been received and which ones have not. 2. One or more frames are transmitted. 3. Finally, the connection is released – freeing up the variables, buffers, and other resources used to maintain the connection. 15
  • 16. Functionality of Data-link Layer • Framing • Data-link layer takes packets from Network Layer and encapsulates them into Frames. Then, it sends each frame bit-by-bit on the hardware. At receiver’ end, data link layer picks up signals from hardware and assembles them into frames. • Addressing • Data-link layer provides layer-2 hardware addressing mechanism. Hardware address is assumed to be unique on the link. It is encoded into hardware at the time of manufacturing. 16
  • 17. • Error Control • Sometimes signals may have encountered problem in transition and the bits are flipped. These errors are detected and attempted to recover actual data bits. It also provides error reporting mechanism to the sender. • Synchronization • When data frames are sent on the link, both machines must be synchronized in order to transfer to take place. 17
  • 18. • Flow Control • Stations on same link may have different speed or capacity. Data-link layer ensures flow control that enables both machine to exchange data on same speed. • Multi-Access • When host on the shared link tries to transfer the data, it has a high probability of collision. Data- link layer provides mechanism such as CSMA/CD to equip capability of accessing a shared media among multiple Systems. 18
  • 19. Framing Framing is the process of breaking the bit stream up into discrete frames. DLL prepares a frame for transport across the local media by encapsulating it with a header and trailer. The data link layer frame includes: Data: The packet from the network layer. Header: contains control information (addressing) and located at the beginning of frame. Trailer: Contains control information added to the end of the frame. 19
  • 20. 20
  • 22. 22
  • 23. 23
  • 24. 24
  • 25. Data link control, ARQ stop/ wait , sliding window protocols 25
  • 26. 10. Flow and Error Control The most important responsibilities of the data link layer are flow control and error control. these functions are known as : data link control. 26
  • 27. Data link control. Data must be checked and processed before they can be used. The rate of such processing is often slower than the rate of transmission. For this reason , each receiver has a buffer to store incoming data until they are processed. If buffer begin to fill up, the sender must slow or halt transmission. 27
  • 28. Flow Control ● One of the most important functions of data link layer. ● A technique for assuring that a transmitting station does not overwhelm a receiving station with data. ● A set of procedures that tells the sender how much data it can transmit before it must wait for an acknowledgement from the receiver. ● Receiver has a limited speed at which it can process incoming data and a limited amount of memory in which to store incoming data. ● Receiver must inform the sender before the limits are reached and request that the transmitter to send fewer frames or stop temporarily. ● Since the rate of processing is often slower than the rate of transmission, receiver has a block of memory (buffer) for storing incoming data until they are processed. 28
  • 29. Error Control • When data-frame is transmitted, there is a probability that data-frame may be lost in the transit or it is received corrupted. • In both cases, the receiver does not receive the correct data-frame and sender does not know anything about any loss. • In such case, both sender and receiver are equipped with some protocols which helps them to detect transit errors such as loss of data-frame. • Hence, either the sender retransmits the data-frame or the receiver may request to resend the previous data-frame. 29
  • 31. Single-bit error Single bit errors are the least likely type of errors in serial data transmission because the noise must have a very short duration which is very rare. However this kind of errors can happen in parallel transmission 31
  • 32. 32
  • 33. The term burst error means that two or more bits in the data unit have changed from 1 to 0 or from 0 to 1. Burst errors does not necessarily mean that the errors occur in consecutive bits, the length of the burst is measured from the first corrupted bit to the last corrupted bit. Some bits in between may not have been corrupted. 33
  • 35. 35 Error Detection and Correction • error detection :: adding enough “extra” bits to deduce that there is an error but not enough bits to correct the error. • If only error detection is employed in a network transmission  retransmission is necessary to recover the frame (data link layer) or the packet (network layer). • At the data link layer, this is referred to as ARQ (Automatic Repeat reQuest).
  • 36. 36 Calculate check bits Channel Recalculate check bits Compare Information bits Received information bits Check bits Information accepted if check bits match Received check bits Error Detection System Using Check Bits
  • 37. Four types of redundancy checks are used in data communications 37
  • 38. Parity Check • One extra bit is sent along with the original bits to make number of 1s either even in case of even parity, or odd in case of odd parity. • The sender while creating a frame counts the number of 1s in it. For example, if even parity is used and number of 1s is even then one bit with value 0 is added. • This way number of 1s remains even. If the number of 1s is odd, to make it even a bit with value 1 is added. 38
  • 39. • The receiver simply counts the number of 1s in a frame. If the count of 1s is even and even parity is used, the frame is considered to be not-corrupted and is accepted. • If the count of 1s is odd and odd parity is used, the frame is still not corrupted. • If a single bit flips in transit, the receiver can detect it by counting the number of 1s. • But when more than one bits are erroneous, then it is very hard for the receiver to detect the error. 39
  • 40. Even and odd Parity Check In EP Even zero put zero, in OP odd zeros put zero 40
  • 41. 41 Error Detection Methods • Vertical Redundancy Check (VRC) – Append a single bit at the end of data block such that the number of ones is even –  Even Parity (odd parity is similar) 0110011  01100110 0110001  01100011 – VRC is also known as Parity Check – Performance: • Detects all odd-number errors in a data block
  • 42. 42 Error Detection Methods • Longitudinal Redundancy Check (LRC) – Organize data into a table and create a parity for each column 11100111 11011101 00111001 10101001 11100111 11011101 00111001 10101001 10101010 11100111 11011101 00111001 10101001 10101010 Original Data LRC
  • 43. 43 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 0 0 1 1 1 Bottom row consists of check bit for each column Last column consists of check bits for each row Two-dimensional Parity Check Code odd parity for check bits column And row Even parity Even parity
  • 44. 44 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 0 0 1 1 0 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 0 0 1 0 0 1 1 0 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 1 1 Two errors One error Three errors Four errors Arrows indicate failed check bits Use even parity
  • 45. 45
  • 46. Automatic Repeat Request(ARQ) • The ARQ is error control technique.. • In this technique, if the data transmitted by the sender arrives at the receiver without any problem, then the receiver reverts by sending an acknowledgment(ACK). • On the contrary to this, if the data to be transmitted gets lost or corrupted in between then the receiver sends a negative acknowledgment(NAK). • Consequently, the sender retransmit the same data again. • There is also provision of the timer with the sender so that if ACK gets lost on the way, then the sender can again retransmit the same data again. 46
  • 47. 47
  • 48.  It is the simplest flow and error control mechanism . A transmitter sends a frame then stops and waits for an acknowledgment.  Stop-and-Wait ARQ has the following features: The sending device keeps a copy of the sent frame transmitted until it receives an acknowledgment( ACK) Stop-and-Wait ARQ 48
  • 49. The sender starts a timer when it sends a frame. If an ACK is not received within an allocated time period, the sender resends it Both frames and acknowledgment (ACK) are numbered alternately 0 and 1( two sequence number only) This numbering allows for identification of frames in case of duplicate transmission 49
  • 50.  The acknowledgment number defines the number of next expected frame. (frame 0 received ACK 1 is sent)  If the receiver detects an error in the received frame, or receives a frame out of order it simply discards the frame  The receiver send only positive ACK for frames received safe; it is silent about the frames damage or lost. Stop-and-Wait ARQ 50
  • 51.  The receiver send only positive ACK for frames received safe; it is silent about the frames damage or lost.  The sender has a control variable S that holds the number of most recently sent frame (0 or 1). The receiver has control variable R, that holds the number of the next frame expected (0,or 1) 51
  • 52. Normal operation  The sender will not send the next frame until it is sure that the current one is correctly receive  sequence number is necessary to check for duplicated frames Stop-and-Wait ARQ 52
  • 53. 1. Stop and Wait ARQ 2. Lost or damaged frame or ACK  A damage or lost frame treated by the same manner by the receiver.  No NACK when frame is corrupted / duplicate 53
  • 54. Sliding Window Protocol • Sliding window algorithms are a method of flow control for network data transfers. • Data Link Layer uses a sliding window algorithm, which allows a sender to have more than one unacknowledged packet "in flight" at a time, which improves network throughput. • The sliding window ARQ technique has two • two categories, namely, • 1. Go-Back –N • 2. Selective Repeat 54
  • 55. • Both the sender and receiver maintain a finite size buffer to hold outgoing and incoming packets from the other side. • • Every packet sent by the sender, must be acknowledged by the receiver. • The sender maintains a timer for every packet sent, and any packet unacknowledged in a certain time, is resent. 55
  • 56. • The sender may send a whole window of packets before receiving an acknowledgement for the first packet in the window. • This results in higher transfer rates, as the sender may send multiple packets without waiting for each packet's acknowledgement. • The Receiver advertises a window size that tells the sender how much data it can receive, in order for the sender not to fill up the receivers buffers 56
  • 57. 57
  • 59. Multiple Access  Problem: When two or more nodes transmit at the same time, their frames will collide and the link bandwidth is wasted during collision  How to coordinate the access of multiple sending/receiving nodes to the shared link???  Solution: We need a protocol to coordinate the transmission of the active nodes  These protocols are called Medium or Multiple Access Control (MAC) Protocols belong to a sublayer of the data link layer called MAC (Medium Access Control) 59
  • 60. • What is expected from Multiple Access Protocols: – Main task is to minimize collisions in order to utilize the bandwidth by: • Determining when a station can use the link (medium) • what a station should do when the link is busy • what the station should do when it is involved in collision 60
  • 61. MAC • The media access control (MAC) data communication protocol sub-layer. • It provides addressing and channel access control mechanisms that make it possible for several terminals or network nodes to communicate within a multiple access network that incorporates a shared medium, e.g. Ethernet. 61
  • 62. • The hardware that implements the MAC is referred to as a medium access controller. • The MAC sub-layer acts as an interface between the logical link control (LLC) sublayer and the network's physical layer. • The MAC layer emulates a full-duplex logical communication channel in a multi-point network. • This channel may provide unicast, multicast or broadcast communication service. 62
  • 64. Random Access Protocols • when node has packet to send – transmit at full channel data rate R (generally no pieces) – NO a priori allocation of channel among nodes • two or more transmitting nodes on channel ➜ “collision” • random access MAC protocol specifies: – how to detect collisions – how to recover from collisions (e.g., via delayed retransmissions) • examples of random access MAC protocols: – slotted ALOHA – ALOHA – CSMA, CSMA/CD, CSMA/CA 64 64
  • 65. 65 Aloha – Basic Technique • Basic idea: – When you’re ready, transmit – Receiver’s send ACK for data – Detect collisions by timing out for ACK – Recover from collision by trying after random delay
  • 66. 66 Slotted Aloha • Time is divided into equal size slots (= pkt trans. time) • Node (w/ packet) transmits at beginning of next slot • If collision: retransmit pkt in future slots with probability p, until successful Success (S), Collision (C), Empty (E) slots
  • 67. Ethernet • Ethernet, sometimes simply called LAN, is a family of protocols used in wired LANs, described by a set of standards together called IEEE 802.3 published by the Institute of Electrical and Electronics Engineers. 67
  • 68. The Basic operation of Ethernet Bus This is a coax based Ethernet network where all machines are chained using RG58 coaxial cable (sometimes referred to as Thin Ethernet or Thin- net). 68
  • 69. • Machine 2 wants to send a message to machine 4, but first it 'listens' to make sure no one else is using the network. • If it is all clear it starts to transmit its data on to the network (represented by the yellow flashing screens). • Each packet of data contains the destination address, the senders address, and of course the data to be transmitted. 69
  • 70. • The signal moves down the cable and is received by every machine on the network but because it is only addressed to number 4, the other machines ignore it. • Machine 4 then sends a message back to number 2 acknowledging receipt of the data (represented by the purple flashing screens) 70
  • 71. Collision • What happens when two machines try to transmit at the same time? a collision occurs. • The resulting collision destroys both signals . 71
  • 73. Ethernet and CSMA/CD • Ethernet uses a protocol called CSMA/CD, this stands for Carrier Sense, Multiple Access with Collision Detection. To understand what this means lets separate the three parts: • Carrier Sense - When a device connected to an Ethernet network wants to send data it first checks to make sure it has a carrier on which to send its data (usually a piece of copper cable connected to a hub or another machine). 73
  • 74. • Multiple Access - This means that all machines on the network are free to use the network whenever they like so long as no one else is transmitting. • Collision Detection - A means of ensuring that when two machines start to transmit data simultaneously, that the resultant corrupted data is discarded, and re-transmissions are generated at differing time intervals 74
  • 75. Carrier Sense multiple access (CSMA) • CSMA: listen before transmit, i.e., don’t interrupt others, wait until there is a pause: – if channel sensed empty : transmit entire frame – if channel sensed busy, defer transmission • When channel sensed empty: collisions can still occur: – propagation delay means two nodes may not hear each other’s transmission and the collision occurs in mid transmission • When channel sensed busy: collisions can still occur: – deferred nodes all detect pause at the same time after a transmission is completed and will attempt to transmit • Collision: entire packet transmission time wasted – distance & propagation delay play role in in determining collision probability 7575
  • 76. CSMA with Collision Detection (CSMA/CD) • CSMA/CD: carrier sensing, deferral as in CSMA  collisions detected within short time (propagation delay)  colliding transmissions aborted and a jam signal transmitted, reducing channel wastage • collision detection:  easy in wired LANs: measure signal strengths, compare transmitted and received signals – difficult in wireless LANs: received signal strength overwhelmed by local transmission strength – detection not functional --> don’t use /CD. Use Collision Avoidance (CA). Small reservation packets used to request channel usage. Possible because of centralized architecture (Access Point (AP). 76 76
  • 77. CSMA with Collision Detection (CSMA/CD) 1. NIC receives datagram from network layer, creates frame 2. If NIC senses channel empty, starts frame transmission. If NIC senses channel busy, waits for pause, then checks if channel idle. If YES transmits, if NO, repeats - waits for next pause. 3. If NIC transmits entire frame without detecting another transmission, NIC is done with frame! 4. If NIC detects another transmission while transmitting, aborts and sends jam signal 5. NIC waits specific time, then it returns to Step 2 7777
  • 78. Collision Domain • Network region in which collisions are propagated. • Repeaters and hubs propagate collisions. • Bridges, switches and routers do not. Collision frequency can be kept low by breaking the network into segments bounded by: – Bridges, switches, routers 78
  • 79. 79
  • 80. 80
  • 81. 81
  • 82. 82
  • 83. 83
  • 84. 84
  • 85. Address Resolution Protocol ARP ARP Purpose  Sending node needs a way to find the MAC address of the destination for a given Ethernet link The ARP protocol provides two basic functions:  Resolving IPv4 addresses to MAC addresses  Maintaining a table of mappings 85
  • 86. ARP Functions/Operation ARP Table  Used to find the data link layer address that is mapped to the destination IPv4 address.  As a node receives frames from the media, it records the source IP and MAC address as a mapping in the ARP table. ARP Request  Layer 2 broadcast to all devices on the Ethernet LAN.  The node that matches the IP address in the broadcast will reply.  If no device responds to the ARP request, the packet is dropped because a frame cannot be created. 86
  • 92. 92 Channel Partitioning MAC protocols TDMA: time division multiple access Frequency time Frequency time FDMA: frequency division multiple access CDMA: code division multiple access  Same frequency and time but different codes. 4 users Example: 92
  • 93. Multiplexing • Multiplexing : dividing link bandwidth into “shares” – frequency division or -time division • frequency time frequency time 4 users 93
  • 94. Time Division Multiplexing • In TDM digital signals are divided in frames, equivalent to time slot i.e. frame of an optimal size which can be transmitted in given time slot. • TDM works in synchronized mode. Both ends, i.e. Multiplexer and De-multiplexer are timely synchronized and both switch to next channel simultaneously. 94
  • 95. • When channel A transmits its frame at one end, the De-multiplexer provides media to channel A on the other end. As soon as the channel A’s time slot expires, this side switches to channel B. • On the other end, the De-multiplexer works in a synchronized manner and provides media to channel B. Signals from different channels travel the path in interleaved manner. 95
  • 96. Frequency Division Multiplexing • In Frequency Division Multiplexing, Data Streams are carried simultaneously on the same Transmission medium by allocating to each of them a different Frequency Band within the Bandwidth of the Single Channel. frequency time 4 users 96
  • 97. Wireless, LAN standards & Devices: Ethernet and IEEE standards for LANs 97
  • 98. 98 Classification of Wireless Networks • Base Station :: all communication through an Access Point (AP) {note hub topology}. Other nodes can be fixed or mobile. • Infrastructure Wireless :: AP is connected to the wired Internet. • Ad Hoc Wireless :: wireless nodes communicate directly with one another. • MANETs (Mobile Ad Hoc Networks) :: ad hoc nodes are mobile. 98
  • 99. Wireless Networks (a) Wireless networking with a base station. (b) Ad hoc networking. 99
  • 100. IEEE 802 • IEEE 802 is a family of IEEE standards dealing with local area networks and metropolitan area networks. The complete IEEE 802 protocol suite provides a diverse set of networking capabilities. • For example, MAC bridging (IEEE 802.1D) deals with the routing of Ethernet packets using a Spanning Tree Protocol. IEEE 802.1Q describes VLANs, and IEEE 802.1X defines a port-based Network Access Control protocol, which forms the basis for the authentication mechanisms used in VLANs (but it is also found in WLANs) – it is what the home user sees when the user has to enter a "wireless access key" 100
  • 101. Standards Organizations Institute of Electrical and Electronics Engineers IEEE  38 societies  130 journals  1,300 conferences  each year  1,300 standards and  projects  400,000 members  160 countries  IEEE 802.3  IEEE 802.11 101
  • 102. 102 Ethernet Standards • Standardization – Institute of Electrical and Electronics Engineering (IEEE) • 802 LAN/MAN Standards Committee (802 Committee) creates LAN standards – 802.3 Working Group creates Ethernet standards – So Ethernet standards are also known as 802.3 standards.
  • 103. 103 Ethernet evolution through four generations 103
  • 104. 104
  • 105. 105
  • 106. 106 Ethernet Standards • Ethernet – Ethernet standards dominate in small LANs – Governs switches – Governs wiring – Governs stations (network interface cards)
  • 107. 107 Elements of a Small Ethernet PC Network Access Router A1-44-D5-1F-AA-4C D4-47-55-C4-B6-9F To the internet Ethernet Switch or Hub B2-CD-13-5B-E4-65 C3-2D-55-3B-A9-4F UTP UTP UTP UTP UTP Broadband Modem Client Client Server Server
  • 108. 108 Typical 802.11 Wireless LAN Operation with Access Points Switch Client PC Server Large Wired LAN Access Point A UTP Radio Link Notebook
  • 109. 109 Typical 802.11 Wireless LAN Operation with Access Points • The Wireless Station sends an 802.11 frame to a server via the access point • The access point is a bridge that converts the 802.11 frame into an 802.3 Ethernet frame and sends the frame to the server Mobile Station Access Point Ethernet Switch Server 802.11 Frame 802.3 Frame
  • 110. 110 Typical 802.11 Wireless LAN Operation with Access Points • The server responds, sending an 802.3 frame to the access point • The access point converts the 802.3 frame into an 802.11 frame and sends the frame to the mobile station. Mobile Station Access Point Ethernet Switch Server 802.11 Frame 802.3 Frame
  • 111. LAN (Interconnection) devices: Repeaters, Hubs, Bridges , Switches and Routers, 111
  • 112. Hardware, Software and Networks Peripherals (device) • Network Interface Card (NIC) • Repeater • Hub • Bridge • Routers • Switch 112
  • 113. 113
  • 114. Repeater • A physical layer device the acts on bits not on frames or packets • Can have two or more interfaces When a bit (0,1) arrives, the repeater receives it and regenerates it, the transmits it onto all other interfaces – Used to boost the signal between two cable segments or wireless access points. – Can not connect different network architecture. – It amplify the signal, 114
  • 115. Hardware, Software and Networks Peripherals (cont.) Repeaters 115
  • 116. Network Hardware • Hub – An unintelligent network device that sends one signal to all of the stations connected to it. • Acts on the physical layer Operate on bits rather than frames. Also called multiport repeater. Used to connect stations adapters in a physical star topology but logically bus. • Connection to the hub consists of two pairs of twisted pair wire one for transmission and the other for receiving. • Hub receives a bit from an adapter and sends it to all the other adapters without implementing any access method. 116
  • 118. 118 Hub Operation D4-47-55-C4-B6-9F UTP UTP UTP UTP Station A1-44-D5-1F-AA-4C Transmits a bit. Hub broadcasts the bit out all ports. A1-44-D5-1F-AA-4C B2-CD-13-5B-E4-65 C3-2D-55-3B-A9-4F Ethernet Hub
  • 119. 119 Waiting to Transmit with a Hub UTP UTP UTP UTP Station A1-44-D5-1F-AA-4C is transmitting. Station B2-CD-13-5B-E4-65 wishes to transmit. It must wait. A1-44-D5-1F-AA-4C Transmitting B2-CD-13-5B-E4-65 Waiting C3-2D-55-3B-A9-4F Ethernet Hub D4-47-55-C4-B6-9F
  • 120. Switch • A switch is a network interconnection device (with multiple interfaces) that accepts a frame from an interface and forwards the frame to the interface corresponding to the MAC destination address in the frame. • A switch: • Operates on frames. • Understands MAC addresses.  Switches allow separate pairs of computers to communicate at the same time.  Switches can be used in heavily loaded networks to isolate data flow and improve performance. 120
  • 121. 121 Switch Operation UTP UTP UTP UTP Ethernet Switch C3-2D-55-3B-A9-4F On Switch Port 15 D4-47-55-C4-B6-9F On Switch Port 16 A switch sends a frame out a single port— the one to the receiver A1-44-D5-1F-AA-4C On Switch Port 10 B2-CD-13-5B-E4-65 On Switch Port 13 Frame Frame
  • 122. 122 Switch Operation with Multiple Simultaneous Conversations UTP UTP UTP UTP Ethernet Switch C3-2D-55-3B-A9-4F On Switch Port 15 D4-47-55-C4-B6-9F On Switch Port 16 Multiple simultaneous conversations are possible A1-44-D5-1F-AA-4C On Switch Port 10 B2-CD-13-5B-E4-65 On Switch Port 13
  • 123. 123 Ethernet Switching Table Switching Table PortStation 10 A1-44-D5-1F-AA-4C 13 B2-CD-13-5B-E4-65 15 C3-2D-55-3B-A9-4F 16 D4-47-55-C4-B6-9F Ethernet Switch UTP UTP UTP UTP A1-44-D5-1F-AA-4C B2-CD-13-5B-E4-65 C3-2D-55-3B-A9-4F D4-47-55-C4-B6-9F 15 C3-2D-55-3B-A9-4F On Port 10 On Port 13 On Port 15 On Port 16 Frame Frame
  • 125. Network Hardware • Bridge – A bridge is a network interconnection device (with only two interfaces) that forwards frames coming in from an interface to the outgoing interface corresponding to the MAC destination address in the frame – bridge is used to connect two local-area networks (LANs) of the same type. 125
  • 127. Router • A router is a network interconnection device that accepts an IP datagram from an incoming port and forwards the datagram to the outgoing link that corresponds to the IP destination address in the frame. • The router Forwards data depending on IP addresses, not Hardware (MAC) addresses. Isolates each LAN into a separate subnet, with separate IP addresses. • Can route between different LAN technologies.. – Routers are the only one of these four devices that will allow you to share a single IP address among multiple network clients. 127
  • 128. Examples of network devices connections 128
  • 129. 129
  • 130. 130
  • 131. 131
  • 132. 132
  • 133. End of part 4 End of the course 133