Lecture 7
Lecture 7
Introduction to Computer
Networks
Lecture 7
Rachee Singh
https://www.racheesingh.com/computernetworks/
1
Administrivia
1. Prelim 1 is on Wednesday, Feb 21st (during lecture)
1. SDS Accommodation: Gates 122
2. Open notes (one page, front and back)
3. Not open laptop/phone/tablet
4. Don’t talk to other people during exam
2. Syllabus: everything until and including the Feb 19th lecture
1. Architecture, design principles, performance metrics, L1, L2
3. Feb 19th, Monday 7-9 PM Gates G01 is the review session
1. Will be recorded
2
Connecting nodes using a link
3
Connecting nodes using a link (Encoding)
Host 1 Host 2
Network Adaptor
5
Connecting nodes using a link (Framing)
1. High-level idea:
1. A special sequence of bits to demarcate the start and end of frame. Example: 01111110
2. Sender side: if the body of the message has any 5 consecutive 1s (11111)
1. Sender inserts a 0 before transmitting the next bit
3. Receiver side: on receiving 5 consecutive 1s (11111)
1. Next bit 0: “stuffed bit”, discard it
2. Next bit 1: either end of frame marker or a bit error
4. Receiver side: on receiving 111111
1. Next bit is 0 (01111110): end of frame marker
2. Next bit is 1 (01111111): error in the frame
6
Connecting nodes using a link (Error Detection)
A D
Point to point
8
Point-to-point vs. broadcast media
1. Broadcast media:
1. Shared wire between many hosts
2. Example: Wifi, traditional Ethernet (before year 2000)
A B C D
Broadcast media
9
Network Adaptor
A D
Point to point
A B C D
Broadcast media
11
Evolution of Ethernet
Bob Metcalfe (Xerox PARC)
1. Shared wired media
2. Broadcast channel
1. Each packet is received by all hosts
2. CSMA/CD for media access control
3. Remember present-day Ethernet is “switched”
1. Point to point links between nodes and switches
2. No sharing, no CSMA/CD
3. Will talk about it in a bit
12
Broadcast
A B C D
Broadcast media
13
Broadcast
A B C D
Broadcast media
COLLISION!!
14
Media access control (MAC) protocols
15
ti
ti
Random access protocols
17
Carrier Sense Multiple Access (CSMA)
18
CSMA Collisions
19
CSMA Collision Detection (CD)
20
Limits on CSMA/CD link length and frame size
A D
Broadcast Ethernet
Propagation delay = d
21
Once a collision is detected..
22
Ethernet: CSMA/CD Protocol
23
CSMA/CD Example
K=1
Select wait time
from {0, 21 - 1} or Attempt 1: Suppose a collision happens
{0, 1}
If both wait for 0
If both wait for 1
24
Performance of CSMA/CD
25
Broadcast vs. Switched Ethernet
26
Why Switched Ethernet?
B
1. Switched Ethernet
A C
1. Enables concurrent communication Ethernet switch
27
Switched Ethernet Topics
28
Ethernet Frames
29
Switched Ethernet Topics
30
Ethernet Frames
31
Ethernet Frames
32
Where does a new frame begin?
33
Framing problem
34
Framing with sentinel bits
1. If the next bit is 0, remove the bit and begin counting again
1. This must be a stuffed bit.
2. Can’t be at the start or end of the frame since those have six or seven 1s
2. If the next bit is 1 (sixth 1) then:
1. If the following bit is a 0 => start of frame since the receiver has seen 01111110
2. If the following bit is a 1 => end of frame since the receiver has seen 01111111
36
Example frame with sentinel bits