0% found this document useful (0 votes)
29 views64 pages

Chapter - Four of Networking

Uploaded by

haile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views64 pages

Chapter - Four of Networking

Uploaded by

haile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 64

Chapter Four

Physical and Data link layer


Chapter Outline
 Physical Layer
 Coding and Multiplexing
 Data link layer overview
 Flow and error control
 Medium access control
 Local area networks [Types, Protocols, Performance]
 Wireless Networks
 Switching, Bridging and VLANs
 WAN[Packet switched data network, Circuit switched data
networks,
 ISDN, Private networks
2
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Cntd…
Local Area Networks (LANs)
 are computer networks that connect devices within a limited geographic
area, such as a home, office building, or campus.
 LANs are designed to facilitate communication and data sharing among
devices in close proximity to each other.
LAN types,
 Ethernet LAN: Ethernet is the most common type of LAN technology.
 It uses twisted pair or fiber optic cables to connect devices in a network.
 Ethernet LANs operates at speeds ranging from 10 Mbps (Ethernet) to 10
Gbps
 Wi-Fi LAN: use wireless signals to connect devices within a network.
 It operates in various frequency bands, such as 2.4 GHz and 5 GHz, and
Local Area Networks (LANs)
 LAN Protocols: defines the rules for transmitting data packets over an
Ethernet network.
 Ethernet protocols include Ethernet II (Ethernet 2.0), Fast Ethernet, Gigabit
Ethernet, and 10 Gigabit Ethernet.
 Wi-Fi LANs use protocols defined by IEEE include 802.11a, 802.11b,
802.11g, 802.11n, 802.11ac, and 802.11ax.
 Performance Considerations in LAN
 Bandwidth
 Latency: the delay in transmitting data across a network.
 Reliability: uninterrupted connectivity,minimize packet loss
 Scalability: accommodates an increasing number of devices and users
without significant performance degradation.
Wireles network
 A type of computer network that allows devices to connect and
communicate without the need for physical cables
 types of wireless technology
 WIFI(Radion frequency )
 infrared
 microwave
 satellite
 mobile communication(cellular)
cont’d
 A VLAN is a logical grouping of devices within a LAN, even if they are
physically located on different LAN segments.
 VLANs allow network administrators to create multiple virtual LANs
within a single physical network infrastructure
 Benefits of VLAN
 Broadcast Control
 Security
 Performance Optimization
 Simplified Network Management
Switching
 It is process to forward packets coming in from one port to a port leading
towards the destination.
 When data comes on a port it is called ingress, and when data leaves a port
or goes out it is called egress.
 A communication system may include number of switches and nodes.
 At broad level, switching can be divided into three major categories:

1. Circuit Switching: the data transfer between two nodes must be establish a
path c with each other over a dedicated communication path .
 Circuits can be permanent or temporary application in circuit may have
three phases:
1. Establish a circuit
2. Transfer the data
Message Switching
 the whole message is treated as a data unit and is switching

transferred in its entity.


 it works based on store-and-forward technique
 Message switching was not a solution for streaming media and real-
time applications.
Packet Switching : The entire message is broken down into smaller
chunks called packets.
 The switching information is added in the header of each packet and
transmitted independently.
ISDN (Integrated Services Digital
 It is a telecommunications technology that enables the transmission of
Network)
voice, video, and data over digital telephone lines.
 provides faster and more reliable data transmission rates compared to
analog connections.
 ISDN supports both voice and data services simultaneously, allowing for
integrated communication services.
 It offers multiple channels, each capable of carrying voice or data traffic.

Private Networks: a computer network that is restricted to a specific


organization
 It is designed to provide secure and controlled communication within the
organization.
Data Link Layer
Introduction
 The data link layer is responsible for carrying a frame from one hop

(computer or router) to the next hop; i.e., it has local responsibility

unlike the network layer

 Position of the data link layer


Data Link Layer Protocol Services in Brief
Packetizing (framing or encapsulation)
 Encapsulate datagram/packet into frame, adding header and trailer

Addressing
 MAC (Media Access Control) addresses are used in frame headers to
identify source and destination; different from IP addresses!
Error control
 error control mechanism to ensure that frames (data bit streams) are
transmitted with certain level of accuracy. But to understand how errors
is controlled, it is essential to know what types of errors may occur.
Data Link Layer Protocol Services in Brief
Error control
Reliable delivery between adjacent nodes
 Error control mechanism may involve two ways(Error destcinon and error
corection )
 Error detection
 Errors can be caused by signal attenuation, noise, etc.
 The receiver detects the presence of errors, drops the frame and waits for
retransmission
 Error Correction
 The receiver dectected error and corrects to rectify bit errors without
resorting to retransmission
Cntd…
Flow Control
 Pacing between adjacent sending and receiving nodes

Media Access (Link) Control


 Channel access if medium is shared
 Examples of link layer protocols: Ethernet, 802.11 wireless LAN, token
ring, and PPP

 A datagram can traverse various links within a network path, each link
utilizing different protocols.
 e.g. Ethernet might be used on the initial link, frame relay across
intermediate links, and 802.11 on the final link.
 This diverse protocol implementation allows for seamless data
Where is the link layer implemented?
 It exists in each and every host (end systems and routers)
 It is implemented in adaptor (network interface card - NIC)
 The adaptor
 Implements data link and physical layers
 Attaches into host’s system bus
 e.g., Ethernet card, 802.11 card
 Implemented as a combination of hardware and software
Adaptors Communicating

Receiving side
Sending side
 Looks for errors, flow
 Encapsulates datagram into control, etc.
frame  Extracts datagram and
 Adds error checking bits, flow passes to upper layer
Data Link Control and Protocols
 For reliable data delivery across the link, the data link layer has two
most important responsibilities: flow control and error control,
collectively known as data link control
Error Control
 Networks must be able to transfer data from one device to another with
complete accuracy - our wish
 Data can be corrupted during transmission - many factors exist - like
transmission impairments
 Hence, reliable systems must have a mechanism for detecting and
correcting error
 Error control refers to both error detection and error correction
 In the data link layer, error control refers primarily to methods of error
detection and retransmission
 Anytime an error is detected, specified frames are retransmitted; this
Cntd…

 EDC = Error Detection and Correction bits (redundancy)


 D = Data protected by error checking, may include header fields
 Error detection is not 100% reliable!
 The protocol may miss some errors, but rarely
 A larger EDC field yields better detection and correction but
larger overhead
types of Error
Errors can be classified into two categories:
1. Single-Bit Error: only one bit of a given data unit is changed from 1 to 0 or
from 0 to 1.
 It mainly occurs in Parallel Data Transmission
 e.g. if eight wires are used to send the eight bits of a byte, if one of the wire
is noisy, then single-bit is corrupted per byte

2. Burst Error: two or more bits are changed from 0 to 1 or from 1 to 0


 It is determined from the first corrupted bit to the last corrupted bit.
 The duration of noise in Burst Error is more than the duration of noise in
Single-Bit.
 Burst Errors are most likely to occurr in Serial Data Transmission.
Error Detecting Techniques...
Errors in the received frames are detected by means of Parity Check
and Cyclic
Redundancy Check (CRC) and check sum reading assignment
 Parity check: most common and simple; two varieties

1. simple Parity Check : It is used to validate the integrity of the data.


 The value of the parity bit is assigned either 0 or 1 that makes the number
of 1s in the message block either even or odd depending upon the type of
parity.
 Parity check is suitable for single bit error detection only.
 The two types of parity checking are
1. Even Parity − the total number of bits in the message is made even.
Error Detecting Techniques
1.simple Parity Check ...
Odd Parity − the total number of bits in the message is made odd.
 If number of 1s is odd, parity bit value is 0. If number of 1s is even, parity
bit value is 1.

2. Two-Dimensional Parity Check: a block of bits is organized in a table (rows


and columns) Original 1100111 1011101 0111001 0101001
 After parity bits are calculated and attached

Row parities

column parities
cont’d More overhead
Data and parity bits when transmitted
11001111 10111011 01110010 01010011 01010101
 Can detect most errors, If 2 bits in one data unit are damaged and two
bits in exactly the same positions in another data unit are also damaged,
the checker will not detect an error.
cont’d ...
Cyclic Redundancy Check (CRC) : works based on binary division of the
data bits being sent.
 The divisor is generated using polynomials.
 The sender performs a division operation on the bits being sent and
calculates the remainder.
 Before sending the actual bits, sender adds the remainder at the end of the
actual bits.
 Actual data bits plus the remainder is called a codeword.
 The sender transmits data bits as codewords.
Error Correction
 Error correction can be done in two ways:
1. Backward Error Correction: when the receiver detects an error in the data
received, it requests back the sender to retransmit the data unit.
 Forward Error Correction: when the receiver detects some error in the
data received, it executes error-correcting code, which helps it to auto-
recover and to correct some kinds of errors. e,g hamming code
 Flow control: is used to restrict the amount of data that the
sender can send before receiving an acknowledgement
 Congestion control: refers to a mechanism used by the network to limit
congestion.
 Flow control and congestion control are not really separable, and
we will refer to both as flow control
 Limiting factors: speed of the receiver (to process incoming data),
amount of memory (buffer) to store the incoming data before
Flow control ...
 Rate of processing is normally slower than rate of
transmission
 The receiver must be able to inform the sender to
temporarily halt transmission until it is ready to receive
more.
 If no flow control, when overload occurs
 Queues build up
 Packets are discarded
 Sources retransmit packets
 Congestion increases network instability
 Flow control prevents network instability by keeping packets
waiting outside the network rather than in queues inside the
Flow and Error Control Mechanisms
1. A Utopian Simplex Protocol
 Simplex transmission: from sender to receiver
 Processing time is ignored; the receiver is assumed to
process the received data infinitely quickly
 Infinite buffer space is assumed to be available on all
nodes
 Communication channel is assumed to be free of error
2. Stop-And-Wait ARQ: a protocol in which the sender
should wait until the acknowledgment is received from the
receiver for frame-1.
 The sender will wait for the response of the receiver, and then
it will send the next data frame.
 Data traffic is simplex, but frames travel in both directions;
hence a half-duplex physical channel suffices.
cont’d ...
3. Sliding Window Protocols
 a protocol used as a method of flow control in networks for the transfer of
data.
 Multiple frames can be sent at a time by the sender before receiving any
acknowledgment from the receiver.
 the receiver can send the acknowledgment of multiple frames transmitted by
the sender using a single ACK frame.
 Use full-duplex transmission
 Two protocols: Go-Back-N ARQ and Selective Repeat ARQ
 Both methods require frames to be numbered.
 Sequence numbers
 Frames from a sending station are numbered sequentially from 0 to 2m-1,
where m is the number of bits of the sequence number in the frame
cont’d
A. Go-Back-N-ARQ
 The sender and receiver have sliding windows
 The sender’s window is of fixed size and is at most 2m-1; but other
protocols such as TCP allow variable size windows , it holds frames sent
but not acknowledged.
 The receiver’s window is of size 1
 The sender sets a timer for each frame sent; the receiver has no timer
 The receiver sends positive acknowledgement if a frame has arrived
safe and in order.
 If a frame is damaged or out of order, the receiver discards it and keeps
silent and discards all subsequent frames; this causes the timer of the
sender to expire and goes back and resends all frames, beginning from the
one with the expired timer.
 The receiver does not need to acknowledge Individually frames
cont’d ...
B. Selective Repeat ARQ
 For a noisy link, use Selective Repeat ARQ for resending only the
damaged frame.
 the correct frames are received and buffered.
 The receiver keeping track of sequence numbers buffers the frames in
memory and sends NACK for only frames which are missing or
damaged.
 The sender will send/retransmit a packet for which NACK is received
 The sender and receiver windows are both at most half of

(window size is m)
data link layer protocols
1. HDLC (High-Level Data Link Control) is a bit-oriented protocol that used
for communication over the point-to-point and multipoint links that
implemets ARQ(Automatic Repeat Request) mechnism.
 support full-duplex communication is possible
2. PPP - Point-to-Point Protocol
 Used in the Internet for router-to-router and home user-to-ISP
traffic, e.g., dialup link, ISDN line
 One sender, one receiver, one link: easier than broadcast link
 No Media Access Control
 No need for explicit MAC addressing (use logical link control)
 No error correction/recovery, no flow control, out of order
delivery OK

 It does not include features like MAC addressing, error


correction, flow control, or data re-ordering, as those
responsibilities are typically delegated to higher-layer
Media (Multiple) Access Control...
 Types of connections or link-layer channels or links
 Point-to-point: provides a dedicated link between two devices (i.e.,
only one sender and only one receiver and hence no collision),
 PPP is used
 Multipoint (or broadcast channel): more than two devices share a
single link (spatially - simultaneously - or temporally by taking
turns), e.g., Ethernet LANs, wireless LANs ( WiFi), satellite
networks, and hybrid fiber-coaxial cable (HFC) access networks
 Multiple Access Protocols
 The problem of controlling the access to the medium is similar
to the rules of speaking in an assembly (the right to speak is
upheld; two people do not speak at the same time; do not interrupt
each other; do not monopolize the discussion; ...)
Media (Multiple) Access Control....
 Three categories of multiple access protocols
1. Random Access Protocols - try your best like taxis do
i. MA - Multiple Access
ii.CSMA - Carrier Sense MA
iii.CSMA/CD - CSMA with Collision Detection
iv.CSMA/CA - CSMA with Collision Avoidance
2. Controlled-Access (Taking-turns) Protocols - get permission
i. Reservation
ii.Polling
iii.Token Passing
3. Channelization (or Channel Partitioning) Protocols -
simultaneous use
i. FDMA - Frequency-Division MA
ii.TDMA - Time-Division MA
iii.CDMA - Code-Division MA
Media (Multiple) Access Control....
1. Random Access (contetion )Protocols
 Each station has the right to use the medium without being
controlled by any other station
 Channel is not divided; hence collision may occur if more than one
station tries to send
 We need a procedure to answer the following questions
 When can a station access the medium?
 What can the station do if the medium is busy?
 How can the station determine the success or failure of the
transmission?
 What can the station do if there is an access conflict?

i. MA - Multiple Access
 ALOHA is the earliest RA method developed at the
University of Hawaii in the early 1970s.
 Originally designed to be used on a radio LAN with a data rate of
9600 bps. Aloha (in Hawaiian language) means hello and
goodbye
Media (Multiple) Access Control....
 A base station serves as a central controller; each station sends a frame to
the base station with an uplink frequency of 407 MHz (the solid line in the
figure); the base station sends it to the receiver using a downlink frequency
of 413 MHz (the dashed line in the figure)
Media (Multiple) Access Control....
 Potential collisions exist (on the upload link); so wait for
acknowledgement; if none arrives wait a period of time (2 times the
maximum propagation delay), send again if back off (waiting) limit did
not reach; the time it waits increases from one trial to the next
 Versions
 Pure ALOHA :allows network nodes to transmit data whenever they have
a frame to send, without checking for the status of the channel.
 Slotted ALOHA
 Time is divided into discrete intervals of one frame duration
 The nodes are synchronized so that each node knows when
a slot begins
 Transmitting a frame is allowed only at the beginning of a slot
 Still collision is possible; collided packets are retransmitted after
a random delay
Media (Multiple) Access Control...
ii. CSMA - Carrier Sense MA - polite version of ALOHA
 To minimize the chance of collision, each station first listens to the
medium before sending; “listen before talk”; in the network world
this is called carrier sensing
 If the channel is busy, it waits until it is idle
 Otherwise it transmits; if a collision occurs, it waits a random
amount of time and starts listening again
 The chance of collision is minimized
 But may still occur because of the propagation delay (a
station doesn’t know if another one has just started
transmitting) or
 If two or more stations start transmitting at the same time
Media (Multiple) Access Control...
iii. CSMA/CD - CSMA with Collision Detection
 Adds a procedure to handle a collision
 A transmitting station listens to the channel while it is transmitting
(collision detection); if a collision is detected and to reduce the
probability of collision the second time, the sender waits; it has to
back off.
 It waits a little the first time, more if a collision occurs again, much
more if it happens a third time, and so on; finally it gives up
 In the exponential backoff method, it waits an amount of time
between 0 and (2 power N x maximum_propagation_time),
where N is the number of attempted transmissions
 Used in traditional Ethernet
Media (Multiple) Access Control...
iv. CSMA/CA - CSMA with Collision Avoidance

 Tries to avoid collision

 After it finds the line idle, it waits an interframe gap


(IFG) amount of time; it then waits another random
amount of time; after that it sends the frame and sets a
timer;
 If it receives an ack before the timer expires, the
transmission is successful; otherwise something is wrong
(the frame or the ack is lost); waits for a backoff amount of
time and re-senses the line
 Used in wireless LANs
Media (Multiple) Access Control...
2. Controlled- Access (Taking-Turns) Protocols
 The stations consult one another to find which station has the right to
send; a station can’t send unless it has been authorized by other
stations
1. Reservation
 A station needs to make a reservation before sending data
 Time is divided into intervals; in each interval, a reservation frame
precedes the data frames sent in that interval; if there are N stations in
the system, there are exactly N reservation mini slots in the
reservation frame
Media (Multiple) Access Control...
ii. Polling
 One device is designated as a primary (master) station and the other
stations are secondary stations
 The primary asks the secondaries if they have data to send (polling) in a
round-robin fashion; when it has data to be sent, the primary tells the
secondary to get ready to receive (selecting)
 This protocol eliminates collisions
 But it introduces a polling delay and a single point of failure - if the
primary fails
Media (Multiple) Access Control...
iii. Token Passing
 A station is authorized to send data when it receives a special frame
called a token
 The stations are arranged around a ring (each station has a
predecessor and a successor)
 A token circulates around the ring when no data is transmitted
 Token: a bit sequence
 Free token: 01111110
 Busy token: 01111111
 When a node wants to transmit
 Waits for a free token
 Removes the token from ring (replaces it with a busy token)
 Transmits the message
 When done transmitting, replaces a free token on the ring
Media (Multiple) Access Control...
 Token failures: tokens can be created or destroyed by noise

 Distributed solution

 Nodes are allowed to recognize the loss of a token and create a new
token

 Collision occurs when two or more nodes create a new token at the
same time need collision resolution algorithms

 Node failures: since each node must relay all incoming data, the failure
of a single node will disrupt the operation of the ring

 E.g., FDDI - Fiber Distributed Data Interface - is a 100 Mbps fiber


optic token ring LAN standard,

 It is also used for MANs


Media (Multiple) Access Control...
3. Channelization Protocols: the available bandwidth of a link is shared in
time, frequency, or through code, between different stations/nodes.

i. FDMA - Frequency-Division MA

 The available bandwidth is divided into channels; the R bps channel


is divided into different frequencies, each with a bandwidth of R/N,
where N is the number of stations
 Example: 6-station LAN; 1, 3, 4 have packets, frequency bands 2, 5, 6
are idle
Media (Multiple) Access Control...
ii.CDMA - Code-Division MA : information can be sent simultaneously
through several transmitters over a single communication channel.
 It is achieved in below steps:
 A signal is generated which extends over a wide bandwidth.
 The code which performs this action is called spreading code.
 Later on, a specific signal can be selected with a given code even
in the presence of many other signals.
 It is mainly used in mobile networks like 2G and 3G

iii. TDMA- Time-Division MA: the stations share the capacity of the
channel in time; time is divided into time frames and each time frame is
further divided into N time slots; each station is allocated a time slot during
which it can send data

 e.g., 6-station LAN; 1, 3, 4 have packets, slots 2, 5, 6 are idle


Addressing
 logigical addresses and MAC (or LAN or Physical or Ethernet) address
 The data link layer hardware does not understand IP addresses to send a
frame from one node to the next
 A NIC provides a 6-byte physical address in hexadecimal; there are 248
possible LAN addresses; a NIC’s address is permanent
- the address is burned into its ROM during manufacturing, also sometimes
software set table
 e.g., 06-01-02-01-2C-4B
 MAC address allocation is administered by IEEE
 A NIC manufacturer buys a portion of the MAC address space (to assure
uniqueness)
 MAC is a flat address ➜ portability
 One can move a LAN card from one LAN to another
 IP is a hierarchical address ➜ NOT portable
Addressing
 Unicast, Multicast, and Broadcast addresses: a source address is always
a unicast address; the destination address can be unicast (only one
destination), multicast (multiple destinations), or broadcast (all the
stations on the network) 48 1s - FF-FF-FF-FF-FF-FF in hexadecimal
 Address Resolution :mapping ofMAC address is a local address and IP
is global address
 Two types of mapping: static and dynamic
 Static Mapping
 Create a table that associates an IP address with a MAC
address, stored in each machine on a network
 Network performance is degraded to update the table
periodically because of the following reasons
 A machine could change its network card
 In some LANs such as LocalTalk of Apple, the MAC address
changes every time the computer is turned on
 A mobile computer can move from one physical network
Addressing
 Dynamic Mapping
 Each time a machine knows one of the two addresses, it can use a
protocol to find the other one
 Two protocols:
 Address Resolution Protocol (ARP) maps an IP address to a
MAC address and
 Dynamic Host Configuration Protocol (DHCP) maps a MAC
address to an IP address – to be discussed later in the Network
Layer
End of chapter Four
Any question??

You might also like