OSI Data Link Layer [layer 2] By admin 25 July 2008 at 10:34 pm and have

Data Link Layer

2 primary functions:

1. Prepares L3 packets for transmission.
2. Controls access to the physical media.

Accessing the media:

A L3 exchange may involve many L2 and media transitions.
At each hop, routers decapsulate and re-encapsulate frames to match the right media.
The L3 protocol is not aware of which media is used.
L2 includes many types of media and access methods (eg. how it is getting to the wire).
L2 protocols specify the frame type and how to get a frame on and off each medium (media access control method, MAC method).
Devices use adapters to connect to a network (eg. NIC)
The adapter manages the framing and media access control (generates the signal transition).
Routers have different physical interfaces that frame the data as suitable for each link.

Creating A Frame:

L2 protocols require control info such as:

Which nodes are “talking”.
When does a conversation start and stop.
Which errors occurred while the nodes communicated.
Which nodes will communicate next.
L2 encapsulates packets with both a header and a trailer (footer.
Framing breaks the bit stream into decipherable groups.
Frame field types may include a variety of fields.
Not all protocols include all fields. (ref below for examples).

Accessing the media:

L2 connects the software of layers above and L1.
It prepares packets for transmission across media.
Embodied as a physical entity (NIC), but also software.

Data Link Sublayers:

L2 is divided into 2 sub layers:

Logical Link Control (LLC) – places information in a frame (software) and links to L3.
Media Access Control (MAC) – provides L2 addressing and physical signalling (hardware).
Sublayers allow 1 type of frame to access different types of media (eg. Ethernet).

Standards:

The IETF does not define protocols at Network Access.
IEEE, ANSI, ITU-T and vendors define these protocols.

Some of these standards integrate both L2 and L1 services.
Unlike upper layers, L2 processes are both software and hardware.

Thus, often implemented within electronics of devices.

ISO – International Organization for Standardization.
IEEE – Institute of Electrical and Electronic Engineers.
ANSI – American National Standards Institute.
ITU – International Telecommunication Union.

Placing Data on the Media:

Regulating frames onto the media is known as Media Access Control (MAC).
Different L2 protocols ? different methods of MAC.
MAC is equivalent to traffic rules that regulate cars.
The absence of MAC would be chaos.
The method of MAC used depends on:

Media sharing – If and how the nodes share the media.
Topology – How nodes are connected together.

Media Access Control Techniques:

Shared Media:

There are 2 basic MAC methods for shared media:

1. Controlled – Each node takes turns (deterministic, eg. Ring).
2. Contention-based – All nodes compete (opportunistic).

Controlled, (scheduled access or deterministic).

Network devices take turns, in sequence, to access the medium.
If a device does not need to access the medium, the opportunity to use the medium passes to the next device in line.
When one device places a frame on the media, no other device can do so until the frame has arrived at the destination and has been processed by the destination.

Contention-based Access for Shared Media, (non-deterministic).

Any device can try to access the media whenever it needs.
To prevent chaos, a Carrier Sense Multiple Access (CSMA) process checks the media.
If CS from another node is detected, it means that another device is transmitting ? it must wait. (voltage detected)
If no CS is detected ? transmit. (no voltage detected)
Ethernet and Wireless are contention-based.
Still possible for 2 devices to transmit at the same time.
i.e. data collision – all data corrupted ? resend.
contention-based MAC methods have less overhead.
But they do not scale well – as users increase, throughput decreases.
CSMA uses 2 methods for resolving the media contention:

CSMA/CD (Collision Detection).

If a Collision is Detected all devices stop sending and try again later. E.g. Traditional Ethernet.

CSMA/CA (Collision Avoidance).

If the media is free, send a note of intent and then send the data. E.g. 802.11 wireless.

Non-shared Media:

Point-to-Point:

P2P nodes do not have to share with other hosts.
Requires little/no control to place frames onto the media.

Full Duplex and Half Duplex:

With P2P connections, the Data Link layer has to consider whether communication is half-duplex or full-duplex.

Half-duplex, devices can Tx and Rx but not simultaneously (e.g. walkie talkie).
Full-duplex, both devices can Tx and Rx simultaneously (e.g. telephone system).
Simplex, a device can only Tx or Rx, not both (e.g. FM radio transmitter).

Topologies:

A topology is the layout or relationship of network devices.
Topologies can be viewed at a physical and a logical level.

Physical topology – an arrangement of nodes and physical connections between them. The representation of how the media is used to interconnect the devices is the physical topology..
Logical topology – is the way a network transfers frames from one node to the next.

L2 “sees” the logical topology of a network when controlling access to the media ? influences framing and MAC used.
Physical topology is rarely the same as logical topology.
Logical and physical topologies typically used in networks are:

Point-to-Point.
Multi-access (bus).
Ring.

Point-to-Point Topology:

Connects 2 nodes directly together.
All frames can only travel to or from the 2 nodes.

Logical Point-to-Point Networks:

End nodes can be physically connected via many devices.
Source and destination nodes may be connected over some distance. (virtual circuits), which is a logical connection created within a network between two network devices.
The media access method used by L2 is determined by the logical P2P topology, not the physical topology. This means that the logical P2P connection may not necessarily be tetween two physical nodes at each end of a single physical link.

Logical Multi-Access topology:

Enables many nodes to communicate on the same shared media.
Data from only one node can be placed on the medium at any one time.
Every node sees all the frames.
Only the addressee processes the contents of the frame (by default).
Requires a L2 MAC method to regulate the transmission.

E.g. CSMA/CD, CSMA/CA or token passing.

Ring Topology:

Each node in turn receives a frame.
If the frame is not addressee to the node it passes the frame on.
All nodes between the source and destination examine the frame.
If no data is being sent, a token (3 bytes) is sent around the ring.
L2 “sees” a logical ring, but the physical topology could be a star shape but the token is passed inside the box (ring in a box – MAU, (MSAU Multi-Station Access Unit).

Media Access Control Addressing and Framing Data:

L2 frames/fields vary according to the protocol.
Each frame type has three basic parts: Header, Data (Addressing), and Trailer.
No one frame meets the needs of all types of media.
Control information varies to match MAC of media and logical topology.

The Header:

Contains the control information specified by the L2 protocol.
Typical frame header fields include:
Start frame – indicates the beginning of the frame.
Src and Dest addresses, (one or the other, or none).
QoS – indicates a particular type of communications service for processing.
Type of Protocol – indicates the upper layer service contained in the frame(ie L3 protocol).
Logical connection cntrl – used to establish a logical connection between nodes.
Physical link cntrl – used to establish the media link.
Flow ctrl – used to start and stop tfc over the media.
Congestion ctrl – indicates congestion in the media.

L2 Addressing:

Physical Addresses.
May be both src and dest.
Not hierarchical (ie flat) – only concerned with local net.
To get outside the network segment, the intermediate device, - a router - will decapsulate the original frame, create a new frame for the packet, and send it onto the new segment.
L2 addressing depends on the logical topology.
P2P topologies, with just two interconnected nodes, do not require addressing. Once on the medium, the frame has only one place it can go.

The Trailer:

L2 protocols add a trailer to each frame. The trailer is used to determine if the frame arrived without error, Frame Check Sequence, (FCS).
FCS field discovers most errors caused on the media.
This process is called error detection – not error correction!.
Used because media could be subject to distortion or loss.
Error detection uses a mathematical summary of frame bits, Cylic redundancy Check (CRC), which is placed in the FCS field of the frame.
The destination node calculates its own CRC and if it does not match the received value the frame is discarded.

The Frame:

There are many L2 protocols in use.

Ethernet.
PPP, (Point-to-Point Protocol).
HDLC, (High Level Data Link Control).
Frame Relay.
ATM, (Asynchronous Transfer Mode).

LAN technology.

Small area. high bandwidth. many hosts.

WAN Technology.

Large areas. lower bandwidth. fewer nodes.

Different needs ? different protocols.

Ethernet Protocol for LANs:

A family of technologies defined in IEEE 802.2 and 802.3 standards.
Both L2 protocols and L1 technologies.
Most widely used LAN technology and supports data BW of 10, 100, 1000, or 10,000Mbps.
Basic frame is consistent across all forms of Ethernet.
Un-ACKed connectionless service over a shared media.
Uses CSMA/CD as the media access methods.
Uses a MAC address – 48 bits and written in hex.
At L1, different versions place bits onto media differently.
Ehternet II is the frame format used in TCP/IP networks.

PPP for WANs:

Used to deliver frames between two nodes.
Unlike most L2 protocols PPP is defined by RFCs.
Can be used over UTP, fiber, and satellite, as well as for virtual connections.
Uses a layered architecture.
To accommodate the different types of media, PPP establishes logical connections called sessions between two nodes, (which is what makes it useful).
Session allow multiple protocols over a P2P link (point to point).
PPP allows 2 nodes to negotiate options like authentication, compression, and multilink.

Wireless for LANs:

802.11 – an extension of IEEE 802 stds.
Uses 802.2 LLC and 48-bit addressing.
Many differences at the MAC sublayer and Physical layer.
External factors may interfere so special controls added.
CSMA/CA – random backoff ? reduces collisions.
Uses ACKs to overcome radio-related problems.
Also includes authentication, association (like SSID), and encryption.

Find out more about Layer 2 Switching security

Tags: guides, vlan, router, wan, ip, switch


Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Live
  • Reddit
  • StumbleUpon
  • Technorati