Академический Документы
Профессиональный Документы
Культура Документы
IK2218/EP2120
Peter Sjödin, psj@kth.se
KTH School of ICT
Acknowledgements
2
Outline
3
The Internet Hourglass
Application DNS VoIP Mail News Video Audio Web Social Media
Everything
Transport on IP
TCP SCTP UDP ICMP
Network IP
Data Link
IP4Gon802.11
Ethernet Optical Power lines Satellite Bluetooth
everything
5
Data Link Layer
Legend Source Destination D Data H Header
A R1 R3 R4 B
Data link Data link
Physical Physical
Link 1 Link 3 Link 5 Link 6
D2 H2
Frame
D2 ame
Fr
H2
D2 H2 D2 H2
Frame Frame
6
Data Link Layer: Context
7
Data Link Layer Scope
8
Link Layer Services
• Framing
- Encapsulate datagram into frame
- Adding header and trailer
• Access control
- Coordinate access from multiple nodes on shared medium
- Half duplex – both sides can send, but not at the same
time
- Full duplex – both sides can send at the same time
• Link addressing
- “MAC” addresses used in frame headers to identify source
and destination nodes
• Specific for link
• Different from Internet (IP) address
• “Physical addressing” in Forouzan
• (MAC stands for Media Access Control)
9
Link Layer Services (continued)
•Flow control
- Rate control
• Prevent receiver from being overrun by faster sender
•Error detection
- Errors caused by signal attenuation, noise, etc.
• Bit values are altered in transit
- Receiver detects presence of errors
• Signals sender for retransmission, or drops frame
•Error correction
- Detect error and repair frame
10
Media Access Protocols
• Channel Partitioning
- divide channel into smaller “pieces” (time slots,
frequency, code)
- allocate piece to node for exclusive use
• For example, radio spectrum is divided into bands
– Often government-regulated and licensed for specific purposes
- FDMA, WDMA, TDMA, CDMA, …
• Frequency/Wavelength/Time/Code Division Multiple
Access
• Random Access
- channel not divided, allow collisions
- “recover” from collisions
Collision
B starts C starts
at time t1 at time t2
A B C D
Area where
B’s A’s signal exists
Area where
both signals exist
Area where
C’s B’s signal exists
Time Time
12
Carrier Sense Multiple Access (CSMA)
14
Outline
15
Ethernet Frame
46-1500 byte
Mediadependent
Media dependent
• Two formats
- IEEE 802.3
• Length field (max 1518 bytes, not including physical layer
header)
- DIX (DEC, Intel, Xerox)
• Type field
– To identify network protocol. For example: network protocol is IP version 4
– Coding compatible with IEEE 802.3: Type codes always greater than 1518
• Most common, and often the default format
16
Ethernet Addresses
• 48-bit addresses
• Usually written in hexadecimal notation,
in six groups with colon ’:’ between
• One bit indicates whether the address is
4A:30:10:21:10:1A
multicast (multiple destinations) or
unicast (one destination) 47:20:1B:2E:08:EE
- Least significant bit in first byte FF:FF:FF:FF:FF:FF
unicast: 0 multicast: 1
17
CSMA/CD
18
CSMA/CD Flow Diagram
19
CSMA/CD Remarks
20
Ethernet Switch (Bridge)
Bridge table
Address Port
71:2B:13:45:61:41 1
71:2B:13:45:61:42 2
64:2B:13:45:61:12 3
64:2B:13:45:61:13 4
Address Port
a. Original
Address Port
Address Port 71:2B:13:45:61:41 1
Address Port
71:2B:13:45:61:41 1 64:2B:13:45:61:13 4
71:2B:13:45:61:41 1
64:2B:13:45:61:13 4 71:2B:13:45:61:42 2
64:2B:13:45:61:13 4
71:2B:13:45:61:42 2 64:2B:13:45:61:12 3
c. After D sends a frame to B d. After B sends a frame to A e. After C sends a frame to D
22
Learning Switch (Bridge)
Address Port
a. Original
Address Port
Address Port 71:2B:13:45:61:41 1
Address Port
71:2B:13:45:61:41 1 64:2B:13:45:61:13 4
71:2B:13:45:61:41 1
64:2B:13:45:61:13 4 71:2B:13:45:61:42 2
64:2B:13:45:61:13 4
71:2B:13:45:61:42 2 64:2B:13:45:61:12 3
c. After D sends a frame to B d. After B sends a frame to A e. After C sends a frame to D
23
Ethernet Standards
• IEEE 802.3
- First standard in 1983
© David Monniaux / Wikimedia Commons / CC-BY-SA-3.0
24
Outline
25
IEEE 802.11 Wireless LAN
wireless hosts
• Building block is a Basic ❒ laptop, smartphone, tablet
Service Set (BSS) ❒ run applications
• Group of wireless nodes ❒ may be stationary (non-
• Possibly with a Base Station mobile) or mobile
- Access Point ❍ wireless does not always
mean mobility
26
Infrastructure Mode
infrastructure mode
❒ Access points
connects wireless
hosts into network
infrastructure
o Base station
network
infrastructure
27
Ad Hoc Mode
ad hoc mode
❒ no access points
❒ nodes can only
transmit to other nodes
within link coverage
❒ nodes self-organize
themselves into a
network: route among
themselves
28
Extended Service Set
distribution system
network
infrastructure ❒ connects the access
points into an ESS
❒ usually a wired LAN
❍ Ethernet
29
Wireless network characteristics
• Multiple wireless senders and receivers create
additional problems (beyond multiple access):
A B C
C
space
Hidden terminal problem
❒ B, A hear each other Signal attenuation
❒ B, C hear each other ❒ B, A hear each other
30
CSMA with Collision Avoidance
802.11 sender sender receiver
1 if sense channel idle for DIFS then
transmit entire frame DIFS
2 else
– start random backoff timer
–count down backoff timer while channel is not busy data
– transmit entire frame when backoff timer expires
– if no ACK, increase random backoff interval, repeat 2
SIFS
CSMA/CA timers
Short InterFrame Spacing (SIFS)
Distributed InterFrame Spacing (DIFS) Larger than SIFS, to give ACK priority over data
31
Avoiding Collisions (more)
reservation collision
DATA (A)
Defer (NAV)
time
33
Wireless LAN Standards
•802.11a •802.11n
- 5-6 GHz range - multiple antennae
- up to 54 Mb/s - 2.4-5 GHz range
•802.11b - up to 200 Mb/s
- 2.4-5 GHz unlicensed •802.11ac
spectrum - 5 GHz range
- up to 11 Mb/s - up to 433 Mb/s (per stream)
•802.11g •802.11ad/h/j/x/y…
- 2.4-5 GHz range
- up to 54 Mb/s
35
PAN – Personal Area Network
36
Bluetooth Piconet
Coordinated by Primary
37
Bluetooth Scatternet
38
Summary
• Ethernet
- CSMA/CD
- 10 Mb/s – 100 Gb/s
- Bridging
• Wireless LAN
- BSS, ESS
- AD hoc and infrastructure mode
- CSMA/CA
• PAN
- Bluetooth and other
- Primary – secondary
- Piconet, scatternet
39
Course Material
• Forouzan, Chapter 2
- Parts about Data Link Layer
• Forouzan Chapter 3
- Except for… (see next slide)
40
Not Covered
41