DATA LINK LAYER
• DataLinkServices
• DataLinkAddressing
Copyright By PowCoder代写 加微信 powcoder
• AddressResolutionProtocol(ARP)
TheInternetisacombinationofnetworksglued together by connecting devices (routers or switches)
If a packet is to travel from source to destination, it needs to pass through these networks
Forexample,communicationatadata-linklayeris made up of five separate logical connections between the data-link layers in the path – see figure
Only one data-link layer is involved at the source or the destination, but two data-link layers are involved at each router
Notethatswitchesarealsoinvolvedinthedata-link- layer communication
Nodes and Links
• Communicationatthedata-linklayerisnode-to-node
• AdataunitfromonepointintheInternetneedstopass through many networks (LANs and WANs) to reach another point. Theses LANs and WANs are connected by routers
• Itiscustomarytorefertothetwoendhostsandthe routers as nodes and the networks in between as links
Data Link Layer Services
• Thedutyscopeofthedata-linklayerisnode-to-node
• Responsiblefordeliveringadatagramtothenextnode in the path
Data Link Layer Services
• Framing: needs to encapsulate the datagram received from the network in a frame, and the data-link layer of the receiving node needs to decapsulate the datagram from the frame
• Whyweneedencapsulationanddecapsulationateach intermediate node?
– The reason is that each link may be using a different protocol with a different frame format.
– Even if the next link is using the same protocol, encapsulation and decapsulation are needed because the link-layer addresses are normally different
Data Link Layer Services – Framing
A packet at the data-link layer is normally called a frame
Data Link Layer Services
Flow Control: Whenever we have a producer and a consumer, we need to think about flow control
Iftherateofproducedframesishigherthantherateof consumed frames, frames at the receiving end need to be buffered while waiting to be consumed (processed).
we cannot have an unlimited buffer size at the receiving side. We have two choices.
– The first choice is to let the receiving data-link layer drop the frames if its buffer is full.
– The second choice is to let the receiving data-link layer send a feedback to the sending data-link layer to ask it to stop or slow down
Data Link Layer Services
• Error Control: At the sending node, a frame in a data- link layer needs to be changed to bits, transformed to electromagnetic signals, and transmitted through the transmission media. At the receiving node, electromagnetic signals are received, transformed to bits, and put together to create a frame
• Sinceelectromagneticsignalsaresusceptibletoerror,a frame is susceptible to error.
• Theerrorneedsfirsttobedetected.Afterdetection,it needs to be either corrected at the receiver node or discarded and retransmitted by the sending node
Two Categories of Links
• point-to-pointlink:usesthewholecapacityofthe medium, the link is dedicated to the two devices; e.g. traditional home phones
• broadcastlink:usesonlypartofthecapacityofthelink, the link is shared between several pairs of devices; e.g. cellular phones
Two Sublayers
• Tobetterunderstandthefunctionalityofandthe services provided by the link layer, we can divide the data-link layer into two sublayers:
– data link control (DLC): deals with all issues common to both point-to-point and broadcast links
– media access control (MAC): deals only with issues specific to broadcast links
Link Layer Addressing
• IPaddressesaretheidentifiersatthenetworklayer that define the exact points in the Internet where the source and destination hosts are connected
• InaconnectionlessinternetworksuchastheInternet we cannot make a datagram reach its destination using only IP addresses, we need a path from source to destination
• IPaddressesinadatagramshouldnotbechanged,we need another addressing mechanism in a connectionless internetwork: the link-layer addresses of the two nodes
Link Layer Addressing
• A link-layer address is sometimes called a link address, sometimes a physical address, and sometimes a MAC address
• Whenadatagrampassesfromthenetworklayertothe data-link layer, the datagram will be encapsulated in a frame and two data-link addresses are added to the frame header. These two addresses are changed every time the frame moves from one link to another.
Link Layer Addressing
Addressing Discussion
• IftheIPaddressofarouterdoesnotappearinany datagram sent from a source to a destination, why do we need to assign IP addresses to routers?
• Theansweristhatinsomeprotocolsaroutermayact as a sender or receiver of a datagram. For example, in routing protocols we will discuss, a router is a sender or a receiver of a message. The communications in these protocols are between routers
Addressing Discussion
• WhydoweneedmorethanoneIPaddressinarouter, one for each interface?
• Theansweristhataninterfaceisaconnectionofa router to a link. We will see that an IP address defines a point in the Internet at which a device is connected. A router with n interfaces is connected to the Internet at n points. This is the situation of a house at the corner of a street with two gates; each gate has the address related to the corresponding street
Addressing Discussion
• HowarethesourceanddestinationIPaddressesina packet determined?
• TheansweristhatthehostshouldknowitsownIP address, which becomes the source IP address in the packet. As we will discuss, the application layer uses the services of DNS to find the destination address of the packet and passes it to the network layer to be inserted in the packet
Addressing Discussion
• Howarethesourceanddestinationlink-layeraddresses determined for each link?
• Eachhop(routerorhost)shouldknowitsownlink-layer address. The destination link-layer address is determined by using the Address Resolution Protocol (ARP)
• Whatisthesizeoflink-layeraddresses?
• Theansweristhatitdependsontheprotocolusedby the link. We may be using different data-link protocols in different links. This means that we can define the size of the address when we discuss different link-layer protocols
Three Types of addresses
• Unicast Address: Each host or each interface of a router is assigned a unicast address. Unicasting means one-to-one communication. A frame with a unicast address destination is destined only for one entity in the link
• Multicast Address: Some link-layer protocols define multicast addresses. Multicasting means one-to-many communication. However, the jurisdiction is local (inside the link).
• Broadcast Address: Some link-layer protocols define a broadcast address. Broadcasting means one-to-all communication. A frame with a destination broadcast address is sent to all entities in the link
Address Resolution Protocol (ARP)
• AddressResolutionProtocol(ARP)isusedtoretrieve the physical address of a node using the IP address
• Anytimeahostorarouterneedstofindthelink-layer address of another host or router in its network, it sends an ARP request packet.
Address Resolution Protocol (ARP)
• Thepacketincludesthelink-layerandIPaddressesof the sender and the IP address of the receiver.
• Becausethesenderdoesnotknowthelink-layer address of the receiver, the query is broadcast over the link using the link-layer broadcast address
• Everynodeonthenetworkreceivesandprocessesthe ARP request packet, but only the intended recipient recognizes its IP address and sends back an ARP response packet that contains the recipient’s IP and link-layer addresses, unicast directly to the node that sent the request packet
ARP Packet Format
ARP Example
ARP Example
ARP Example
Flow of packets at Alice’s computer
Flow of activities at router R1
Flow of activities at router R2
Flow of activities at Bob’s site
References
• DataCommunicationsandNetworking5thedition– 2013, Behrouz A. Forouzan; Chapter 9
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com