The data link layer provides the upper layers access to the network media. It is responsible for controlling access to the media, encapsulating packets into appropriately sized frames for the media used, physical addressing, the exchange of frames between nodes on the local network, and error detection.
Media Access Control
Control Based Access – Controlled access means that devices or nodes take turns in sequence. It is deterministic in that there is scheduled access of the medium. If one device is putting data on the network then no other device can. Well ordered and predictable throughput, can be an inefficient use of bandwidth, as a device has to wait it’s turn.
Contention Based Access – Contention based access is also called non-deterministic. This means that the devices on the network don’t need to take turns using shared media. However, to avoid total chaos, a Carrier Sense Multiple Access (CSMA) process is used to make sure the media is not in use before a device begins to transmit. Though devices attempt to make sure the media is not busy, data collisions still occur with contention based access. Also, as more nodes are added to the network, the probability of collisions increases.
CSMA-CD (Carrier Sense Multi-Access with Collision Detection) is a media access method in which an ethernet host detects if a signal is being transmitted. If no signal is detected on the wire, then the host will transmit. There does exist the possibility that two or more hosts may sense the absence of a signal and transmit at the same time. If this happens, there is a collision of signals.
CSMA-CA (Carrier Sense Multi-Access with Collision Avoidance) stands for Collision Sense Multiple Access with Collision Avoidance. This is used for wireless media access control. It uses a send and reply like the TCPthree way hand shake, in this way it reserves the right to send before sending. After each message is sent the hosts associated to the wireless access point run a randomization algorithm which sets a random priority on who gets to send next. That along with many control fields help to mitigate some of the interferences and other radio related wireless problems.
Physical Topology versus Logical Topology – The physical topology is the arrangement of devices (nodes) and how they are physically connected to the network.
The logical topology is the way data is transferred from one device (node) to another regardless of how the devices are physically connected. It is also related to how each host sees other hosts on the network and how each host accesses the media. A network’s logical topology is not necessarily the same as its physical topology. For instance, in an Ethernet network, computers are often connected to a switch or hub forming a physical star topology, but logically the way the data travels is a bus or multi-access topology. In a Token Ring network, computers are connected to a MAU multistation access unit, forming a physical star, but logically information travels clockwise from host to host in a ring topology. In FDDI, the physical topology is a dual ring (expensive) and logically it is also a ring. For additional information see:http://en.wikipedia.org/wiki/Network_topology
Point to Point Topology – directly connects two nodes. All frames are placed on the media by one node and taken off by the other. It can be both a physical and logical topology. Physically it is two nodes directly connected. Logically it is two nodes virtually connected directly, but passing through a network. It does not include the other devices in separate locations, that the data travels through. In this way it forms a virtual circuit between the two nodes. A virtual Circuit is a logical connection between two nodes and end users do not notice the intermedate devices.
Multi Access Topology – means that the nodes are communicating on the same shared media. Only one node can use the media at a time, and every node sees every frame on the medium. Of course, only the node to which the frame is addressed actually processes the frame. When sharing media, CSMA/CD and token passing are used to reduce collisions.
Ring Topology – In a physical ring topology each device is connected to two neighboring devices creating a physical ring almost like a physical bus. In a logical ring topology each node receives a frame in turn, and if the frame is not addressed to that node, it passes it on. In a Token Ring network, a node cannot send data on the network unless it has the token, the token is then passed to the next node and so on in a logical ring. For more information see: http://en.wikipedia.org/wiki/Ring_network
Data Link Layer Sub Layers
LLC – Logical Link Control sub layer – Helps interface with the upper layers meaning the Network layer. Logical Link Control (LLC) places information in the frame that identifies which Network layer protocol is being used. This information allows multiple Layer 3 protocols, such as IP, IPX, Apple Talk, and DECNet, to utilize the different types of local media and interfaces, like Ethernet, Token Ring, different WAN serial protocols and interfaces such as PPP, HDLC, etc. .
MAC – Media Access Control sub layer – Media Access Control provides data link layer addressing with source and destination MAC addresses. These addresses are 48 bit physical addresses, usually written in hexadecimalformat and burned into the NIC. Media Access Control is also responsible for marking the beginning and the ending of a frame with a start-of-frame and an end-of-frame delimiter. For more information see: http://en.wikipedia.org/wiki/Media_Access_Control
Layer 2 Frames
Layer 2 frame characteristics are similar to other layers. There is a header, the data payload, and the trailer. The specifics of the frame differ in regards to the type of frame in question. There are LAN layer 2 technology frames (Ethernet, Token Ring) and WAN layer 2 technology frames (PPP, HDLC). One of the main differences is that ethernet frames have source and destination MAC addresses in their frame headers and serial technologies like PPP and HDLC do not.