Bài giảng Mạng máy tính - Chapter 5: The data link layer (Part II) - Hồ Phương Đắc

Summary of MAC protocols  
What do you do with a shared media?  
Channel Partitioning, by time, frequency or code  
• Time Division,Code Division, Frequency Division  
Random partitioning (dynamic),  
• ALOHA, S-ALOHA, CSMA, CSMA/CD  
• carrier sensing: easy in some technoligies (wire), hard  
in others (wireless)  
• CSMA/CD used in Ethernet  
Taking Turns  
• polling from a central cite, token passing  
5: DataLink Layer  
5a-1  
LAN technologies  
Data link layer so far:  
services, error detection/correction, multiple  
access  
Next: LAN technologies  
addressing  
Ethernet  
hubs, bridges, switches  
802.11  
PPP  
ATM  
5: DataLink Layer  
5a-2  
LAN Addresses and ARP  
32-bit IP address:  
network-layer address  
used to get datagram to destination network  
(recall IP network definition)  
LAN (or MAC or physical) address:  
used to get datagram from one interface to  
another physically-connected interface (same  
network)  
48 bit MAC address (for most LANs)  
burned in the adapter ROM  
5: DataLink Layer  
5a-3  
LAN Addresses and ARP  
Each adapter on LAN has unique LAN address  
5: DataLink Layer  
5a-4  
LAN Address (more)  
MAC address allocation administered by IEEE  
manufacturer buys portion of MAC address space  
(to assure uniqueness)  
Analogy:  
(a) MAC address: like Social Security Number  
(b) IP address: like postal address  
MAC flat address => portability  
can move LAN card from one LAN to another  
IP hierarchical address NOT portable  
depends on network to which one attaches  
5: DataLink Layer  
5a-5  
Recall earlier routing discussion  
Starting at A, given IP  
A
223.1.1.1  
datagram addressed to B:  
223.1.2.1  
223.1.2.9  
223.1.1.2  
look up net. address of B, find B  
223.1.1.4  
on same net. as A  
B
link layer send datagram to B  
223.1.2.2 E  
223.1.3.27  
223.1.1.3  
223.1.3.1  
inside link-layer frame  
223.1.3.2  
frame source,  
dest address  
datagram source,  
dest address  
A’s IP  
addr  
B’s IP  
addr  
B’s MAC A’s MAC  
IP payload  
addr  
addr  
datagram  
frame  
5: DataLink Layer  
5a-6  
ARP: Address Resolution Protocol  
Each IP node (Host,  
Router) on LAN has  
ARP module, table  
Question: how to determine  
MAC address of B  
given B’s IP address?  
ARP Table: IP/MAC  
address mappings for  
some LAN nodes  
< IP address; MAC address; TTL>  
<
………………………….. >  
TTL (Time To Live): time  
after which address  
mapping will be forgotten  
(typically 20 min)  
5: DataLink Layer  
5a-7  
ARP protocol  
A knows B's IP address, wants to learn physical  
address of B  
A broadcasts ARP query pkt, containing B's IP  
address  
all machines on LAN receive ARP query  
B receives ARP packet, replies to A with its (B's)  
physical layer address  
A caches (saves) IP-to-physical address pairs until  
information becomes old (times out)  
soft state: information that times out (goes  
away) unless refreshed  
5: DataLink Layer  
5a-8  
Routing to another LAN  
walkthrough: routing from A to B via R  
A
R
B
5: DataLink Layer  
5a-9  
A creates IP packet with source A, destination B  
A uses ARP to get R’s physical layer address for 111.111.111.110  
A creates Ethernet frame with R's physical address as dest,  
Ethernet frame contains A-to-B IP datagram  
A’s data link layer sends Ethernet frame  
R’s data link layer receives Ethernet frame  
R removes IP datagram from Ethernet frame, sees its  
destined to B  
R uses ARP to get B’s physical layer address  
R creates frame containing A-to-B IP datagram sends to B  
A
R
B
yer  
5a-10  
Ethernet  
“dominant” LAN technology:  
cheap $5 for 100Mbs!  
first wildey used LAN technology  
Simpler, cheaper than token LANs and ATM  
Kept up with speed race: 10, 100, 1000 Mbps  
Metcalfe’s Etheret  
sketch  
5: DataLink Layer  
5a-11  
Ethernet Frame Structure  
Sending adapter encapsulates IP datagram (or other  
network layer protocol packet) in Ethernet frame  
Preamble:  
7 bytes with pattern 10101010 followed by one  
byte with pattern 10101011  
used to synchronize receiver, sender clock rates  
5: DataLink Layer  
5a-12  
Ethernet Frame Structure  
(more)  
Addresses: 6 bytes, frame is received by all  
adapters on a LAN and dropped if address does  
not match  
Type: indicates the higher layer protocol, mostly  
IP but others may be supported such as Novell  
IPX and AppleTalk)  
CRC: checked at receiver, if error is detected, the  
frame is simply dropped  
5: DataLink Layer  
5a-13  
Ethernet: uses CSMA/CD  
A: sense channel, if idle  
then {  
transmit and monitor the channel;  
If detect another transmission  
then {  
abort and send jam signal;  
update # collisions;  
delay as required by exponential backoff algorithm;  
goto A  
}
else {done with the frame; set collisions to zero}  
}
else {wait until ongoing transmission is over and goto A}  
5: DataLink Layer  
5a-14  
Ethernet’s CSMA/CD (more)  
Jam Signal: make sure all other transmitters are  
aware of collision; 48 bits;  
Exponential Backoff:  
Goal: adapt retransmission attemtps to estimated  
current load  
heavy load: random wait will be longer  
first collision: choose K from {0,1}; delay is K x 512  
bit transmission times  
after second collision: choose K from {0,1,2,3}…  
after ten or more collisions, choose K from  
{0,1,2,3,4,…,1023}  
5: DataLink Layer  
5a-15  
Ethernet Technologies: 10Base2  
10: 10Mbps; 2: under 200 meters max cable length  
thin coaxial cable in a bus topology  
repeaters used to connect up to multiple segments  
repeater repeats bits it hears on one interface to  
its other interfaces: physical layer device only!  
5: DataLink Layer  
5a-16  
10BaseT and 100BaseT  
10/100 Mbps rate; latter called “fast ethernet”  
T stands for Twisted Pair  
Hub to which nodes are connected by twisted pair,  
thus “star topology”  
CSMA/CD implemented at hub  
5: DataLink Layer  
5a-17  
10BaseT and 100BaseT (more)  
Max distance from node to Hub is 100 meters  
Hub can disconnect “jabbering adapter  
Hub can gather monitoring information, statistics  
for display to LAN administrators  
5: DataLink Layer  
5a-18  
Gbit Ethernet  
use standard Ethernet frame format  
allows for point-to-point links and shared  
broadcast channels  
in shared mode, CSMA/CD is used; short distances  
between nodes to be efficient  
uses hubs, called here “Buffered Distributors”  
Full-Duplex at 1 Gbps for point-to-point links  
5: DataLink Layer  
5a-19  
Interconnecting LANs  
Q: Why not just one big LAN?  
Limited amount of supportable traffic: on single  
LAN, all stations must share bandwidth  
limited length: 802.3 specifies maximum cable  
length  
large “collision domain” (can collide with many  
stations)  
limited number of stations: 802.5 have token  
passing delays at each station  
5: DataLink Layer  
5a-20  
Tải về để xem bản đầy đủ
ppt 36 trang myanh 26080 Free
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Mạng máy tính - Chapter 5: The data link layer (Part II) - Hồ Phương Đắc", để tải tài liệu gốc về máy hãy click vào nút Download ở trên

File đính kèm:

  • pptbai_giang_mang_may_tinh_chapter_5_the_data_link_layer_part_i.ppt