Escolar Documentos
Profissional Documentos
Cultura Documentos
TCP router IP
IP packet
TCP
IP
IP
IP packet
IP
Ethernet interface
Ethernet interface
SONET interface
SONET interface
Ethernet interface
Ethernet interface
Ethernet frame
SONET frame
Ethernet frame
Context
Application TCP/IP Presentation Session Transport Network (Data) Link Physical Ethernet Interface
4
OSI
Link Sublayers
Logical Link
Media Access Control (MAC)
Network
host-to-host
Frame
Link
node-to-node frame-by-frame
Physical
101101001000100101010 node-to-node bit-by-bit
The link layer is responsible for frame-level node-to-node communication. Datagram from network layer is encapsulated into a link-layer frame for transmission over physical medium.
5
Node
Bandwidth
Amount of data sent (or received) per unit time Corresponds to the width of the link Typically measured in bits per second bandwidth delay x bandwidth delay
7
Workstation
Workstation
Workstation
Workstation
Workstation
Workstation
point-to-point links
8
. . .
Ethernet cable:
10
10Mbps
Base
5
Cable no longer than 500 m
Ethernet cable:
100
100Mbps
Base
T
Twisted Pairs
The hub replicates the signal along all links, except the one the signal comes from
10
Broadcast medium
All stations receive a copy of the message sent But most communication is intended to be only between two computers on a network
To allow sender to specify destination, each station is assigned a hardware address (MAC address)
11
What is NIC ?
Special-purpose hardware that handles all the details of packet transmission and reception It operates independently of the CPU Compares the destination MAC address on each incoming packet to the MAC address of its own station and discards frames not destined for the station
NIC
Also called link-layer adapter
The link layer is implemented in hardware in the form of an adapter. The adapter can decide to discard frames in error without notifying the OS.
14
Ethernet (802.3)
Ethernet
Is the dominating LAN technology IEEE 802.3 defines Ethernet Layers specified by 802.3:
Ethernet Physical Layer Ethernet Medium Access (MAC) Sublayer
16
Terminator
17
Star Topology
Physically star, logically bus
Hub
18
Repeater
20
Manchester Encoding
21
22
Preamble
Type
Data
CRC
Preamble: 8 bytes used to synchronize the adapter MAC address: 6 bytes (90:AF:F4:CA:BA:03) Type: 2 bytes CRC: 4 bytes (Cyclic Redundancy Check) Ethernet frames must carry at least 46 bytes and at most 1500 bytes of data (not including the 18 bytes of header & trailer).
23
Ethernet Questions:
Q1: An Ethernet MAC sublayer receives 42 bytes of data from the LLC sublayer. How many bytes of padding must be added to the data?
Q2: An Ethernet MAC sublayer receives 1510 bytes of data from the LLC sublayer. Can the data be encapsulated in one frame? If not, how many frames need to be sent ? What is the size of the data in each frame ?
24
25
Ethernet Addressing
Broadcast address:
FF-FF-FF-FF-FF-FF
26
Question
MAC addresses only have significance within the context of a local-area network. So, why are MAC addresses globally unique?
27
28
29
CSMA/CD Idea:
Listen to the channel before transmitting a packet.
30
If collision occurs,
Wait a random amount of time and start over again. The protocol is called 1-persistent because the host transmits with a probability of 1 whenever it finds the channel idle.
31
32
Example:
If stations B and C become ready in the middle of As transmission, B and C will wait until the end of As transmission and then both will begin transmitted simultaneously, resulting in a collision.
If collision occurs
wait a random amount of time and start over again
34
2. Detect collisions
If a collision occurs, wait a random amount of time and go to step 1 One slot = contention period (i.e., one round trip propagation delay)
36
37
CSMA/CD
In CSMA protocols
If two stations begin transmitting at the same time, each will transmit its complete packet, thus wasting the channel for an entire packet time
In CSMA/CD protocols
The transmission is terminated immediately upon the detection of a collision CD = Collision Detect
38
CSMA/CD
Sense the channel
If idle, transmit immediately If busy, wait until the channel becomes idle
Collision detection
Abort a transmission immediately if a collision is detected Try again later according to a backoff algorithm
39
Worst case: 2 x T To detect the collision, A must transmit for at least 2xT time.
40
41
42
Assume A and B collide (kA = kB = 1) A, B choose randomly from 21 slots: [0,1] Assume A chooses 1, B chooses 1 A and B collide (kA = kB = 2) A, B choose randomly from 22 slots: [0,3] Assume A chooses 2, B chooses 0 B transmits successfully A transmits successfully
43
44
Packet? No Sense Carrier Discard Packet attempts < 16 Send Detect Collision Yes Jam channel b=CalcBackoff() wait(b); attempts++;
attempts == 16
45
46
CSMA/CD Question 1
Consider a 10Mb/s CSMA/CD network as shown below:
H1 100 100 100 Hub 100 H3 H2
H10
Calculate the length of the shortest packet that the network above can support so that the CSMA/CD protocol will function correctly. Assume that bits travel on the wire at the speed c = 2 * 108 m/s.
47
CSMA/CD Question 2
The hub is now removed, but the computers remain in the same locations. A single cable is strung between the computers as shown below.
H1 H2 H10 100 100 100 100 100 H9 100 100 H3
CSMA/CD Question 3
Why do Ethernet adaptors select a random back-off time before trying to transmit a frame following a collision? Why do they pick the random back-off time from a larger range after each collision?
49
Interconnecting Devices
There are many different interconnecting devices.
Ethernet Repeater Ethernet Ethernet
52
Layer Session Layer Transport Layer Network Layer (Data) Link Layer Physical Layer
TCP/IP Suite
User data
Repeater
IP IP
LLC
LLC
802.3 MAC
Repeater
802.3 MAC
Token-ring
Bridge
IP
Bridge
LLC LLC
IP
LLC
802.3 MAC
LAN
802.3 MAC
802.5 MAC
LAN
802.5 MAC
59
61
Switch
Memory
outgoing links
62
HighSpeed Backplane
CSMA/CD CSMA/CD
CSMA/CD CSMA/CD
Input Buffers
Output Buffers
Hub
Switch
63
64
65
66
67
Higher cost
More complicated devices that cost more money
68
Cut-Through Switching
Start transmitting as soon as possible
Inspect the frame header and do the look-up If outgoing link is idle, start forwarding the frame
Overlapping transmissions
Transmit the head of the packet via the outgoing link while still receiving the tail via the incoming link
A switches
70
72
Subnetwork
Router
Subnetwork
Application
Application
TCP
TCP
IP
Network Access
IP
Network Access Network Access
IP
Network Access
IP
Network Access
Network Access
Host
Router
Router
Host
73
74
75
Internet
FDDI FDDI
76
Internet
77
Bridges
MAC addresses are hardwired No network configuration needed No routing protocol needed
(sort of) learning bridge algorithm spanning tree algorithm
LAN 2
d
Bridge 3
Bridge 4
LAN 5
Bridge 5
LAN 1
Bridge 2
LAN 3
LAN 4
79
Transparent Bridges
Not visible to end hosts Execute a spanning tree algorithm Two parts to transparent bridges:
1. Learning & Forwarding 2. Spanning Tree Algorithm
LAN 2
Bridge Bridge Bridge
LAN 5
Bridge
LAN 1
Bridge
LAN 3
LAN 4
80
Switch table
Maps destination MAC address to outgoing interface Goal: construct the switch table automatically
B
A switch D
81
D
82
D
83
Example
Consider the following packets:
(Src=A, Dest=F), (Src=C, Dest=A), (Src=E, Dest=C)
Bridge 2
Port2
LAN 1
LAN 2
LAN 3
F
85
Danger of Loops
Switches sometimes need to broadcast frames
Upon receiving a frame with an unfamiliar destination Upon receiving a frame sent to the broadcast address
86
Spanning tree
Sub-graph that covers all vertices but contains no cycles Links not in the spanning tree do not forward frames
87
Messages (Y, d, X)
From node X Claiming Y is the root And the distance to root is d BPDU (Bridge Protocol Data Unit)
88
1 5 2 6
Receives (2, 1, 7) from 7 7 And realizes this is a longer path So, prefers its own one-hop path And removes 4-7 Iink from the tree (temporary view)
90
91
Hub/ Bridge/ Repeater Switch Traffic isolation Plug and Play Efficient routing Cut through no yes no yes yes yes no yes
93
94
Network Categories
Network Categories
DAN
LAN
MAN
WAN
1. DAN Desk Area Network (DeskTop) 2. LAN Local Area Network (Room, Building, Campus) 3. MAN Metropolitan Area Network (City) 4. WAN Wide Area Network (Country, Continent)
96
98
Share printers, files, Internet connections, etc. May include hubs & switches Low Delay Very Few Errors
99
100
101
102
MAN Topology
DBDQ: IEEE 802.6 two one-way buses
Packets travel from the Head and fall off Travel Bus A if Computer to Right Travel Bus B if Computer to Left Optimize delivery
104
105
Source
Subnet
Transmission Line, Trunk, Circuit, Channel Collection of routers and communication lines that move packets from the source to the destination
106
WAN Topologies
Bus Star Tree Mesh Hybrid
107
Summary
Ethernet technology Shuttling data from one link to another
Bits, frames, packets, Repeaters/hubs, bridges/switches, routers,
Network Categories
DAN, LAN, MAN, WAN
108