[go: up one dir, main page]

100% found this document useful (1 vote)
35 views58 pages

Data Link

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 58

Data link 1

RCDA
Ing. Marco A. Ortiz N.
Switch

Features

• Elimination of collisions
• Heterogeneous link
• Management
Switch (conmutador de paquetes)

Switch table:

• Initialy empty
• For each incoming frame received on an interface, the switch
updates its table with the source MAC address and the
interface from which the frame arrived.
Switch

Two functions

•Filtering
• If destination mac address is attached to the same interface (switch table),
drop the frame

•Forwarding
• if there is no entry for the destination address, broadcast frame.
• If destination mac address is a different interface (switch table), forward
frame to destination interface.
Ejercicio

Condiciones iniciales:
Tablas ARP vacias
Tabla de switch vacia
Enrutamiento estático en routers

Enumere todos los pasos (capa por capa) del envío de un segmento TCP.
Switch
VLAN
• Port based
• MAC based

VLAN trunking
• IEEE 802.1Q
Extended Ethernet frame format
Switch

802.1Q
• Tag protocol identifier
• Fixed 81-00
• Tag control information
• 12-bit VLAN identifier bit
Data-link: two categories

The data-link layer controls how the medium is used


• A data-link layer that uses the whole capacity of the medium.
• Point-to-point link: link is dedicated to the two devices.

• A data-link layer that uses only part of the capacity of the link.
• Broadcast link: link is shared between several pairs of devices.
Data-link: two sublayers

DLC and MAC


Link Layer addressing
Link-layer addressing is needed because the source and destination IP
addresses define the two ends but cannot define which links the
datagram should pass through.

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.

A link-layer address is sometimes called a link address, sometimes a


physical address, and sometimes a MAC address.
Link Layer addressing: Three types
Unicast: 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: one-to-many communication. However, the


jurisdiction is local (inside the link).

Broadcast: one-to-all communication. A frame with a


destination broadcast address is sent to all entities in
the link.
Link Layer – DLC services
Deals with procedures for communication between two
adjacent nodes—node-to-node communication—no
matter whether the link is dedicated or broadcast.

Data link control functions include:


• Framing: how to organize the bits that are carried by the
physical layer.
• flow and error control.
DLC services - Framing
Pack bits into frames, so that each frame is distinguishable from another.

Framing in the data-link layer separates a message from one source to a


destination by adding a sender address and a destination address. The
destination address defines where the packet is to go; the sender address
helps the recipient acknowledge the receipt.

A frame can be very large, making flow and error control very inefficient.
When a message is carried in one very large frame, even a single-bit error
would require the retransmission of the whole frame.
Framing – frame size
Fixed or variable size
Fixed-size framing: no need for defining the boundaries
of the frames
• ATM WAN
Variable-size framing: prevalent in local-area networks.
• Two ways to define the end of one frame and the beginning of the next:
• Character-oriented approach
• Bit-oriented approach.
Framing – Character-Oriented Framing
Was popular when only text was exchanged by the data-link
layers.

The flag, composed of protocol-dependent special characters


signals the start or end of a frame.
Framing – Character-Oriented Framing
byte stuffing (or character stuffing) is the process of adding
one extra byte whenever there is a flag or escape character in the text.
Framing - Bit-Oriented
Most protocols use a special 8-bit pattern flag,
01111110, as the delimiter to define the beginning and
the end of the frame.
Framing - Bit-Oriented
If the flag pattern appears in the data, we need to somehow
inform the receiver that this is not the end of the frame. We
do this by stuffing 1 single bit to prevent the pattern from
looking like a flag (Bit stuffing).

Bit stuffing: if a 0 and five consecutive 1 bits are encountered,


an extra 0 is added. This extra stuffed bit is eventually
removed from the data by the receiver. The extra bit is
added after one 0 followed by five 1s regardless of the value
of the next bit.
Framing - bit-stuffing
Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0
in the data, so that the receiver does not mistake the pattern 0111110 for a flag.
Data-Link Layer Protocols - HLDC
High-level Data Link Control (HDLC) is a bit-oriented protocol for
communication over point-to-point and multipoint links.
implements the Stop-and-Wait protocol
normal response mode (NRM)

asynchronous balanced mode (ABM)

20
HLDC - Framing

HDLC defines three types of frames:


• information frames (I-frames)
• supervisory frames (S-frames)
• unnumbered frames (U-frames).

21
HLDC - Framing
Flag field. This field contains synchronization pattern 01111110, which
identifies both the beginning and the end of a frame.
Address field. If a primary station created the frame, it contains a to
address. If a secondary station creates the frame, it contains a from
address. address field can be one byte or several bytes long
The Control field is one or two bytes used for flow and error control.
determines the type of frame and defines its functionality.
Information field. The information field contains the user’s data from
the network layer or management information. Variable length.
FCS field. The frame check sequence (FCS) is the HDLC error detection
field. It can contain either a 2- or 4-byte CRC.

22
HLDC – Framing – Control field

I-frames
I-frames are designed to carry user data from the
network layer. In addition, they can include flow-
and error-control information.

23
HLDC – Framing – Control field

7 6 5 4 3 2 1 0

I-frame

7 Type. 0 means the frame is an I-frame.


4 5 6 N(S) define the sequence number of the frame.
2 1 0 N(R), correspond to the acknowledgment number.
3
It has meaning only when it is set (bit = 1) and can mean poll or final.
• poll when the frame is sent by a primary station to a secondary. (when the address
field contains the address of the receiver)
• final when the frame is sent by a secondary to a primary (when the address field
contains the address of the sender).

24
HLDC – Framing – Control
field

S-frames
Supervisory frames are used for flow and error
control. S-frames do not have information fields.

25
HLDC – Framing – Control field

7 6 5 4 3 2 1 0

S-Frame

7 6 Type. 10 means the frame is an S-frame.


5 4 Define the type of S-frame.

• Receive ready (RR). If the value of the code subfield is 00, it is an RR S-frame. This kind of frame
acknowledges the receipt of a safe and sound frame or group of frames. In this case, the value of the
N(R) field defines the acknowledgment number.
• Receive not ready (RNR). If the value of the code subfield is 10, it is an RNR Sframe. This kind of
frame is an RR frame with additional functions. It acknowledges the receipt of a frame or group of
frames, and it announces that the receiver is busy and cannot receive more frames. It acts as a kind of
congestion-control mechanism by asking the sender to slow down. The value of N(R) is the
acknowledgment number.
• Reject (REJ). If the value of the code subfield is 01, it is an REJ S-frame. This is a NAK frame, but not
like the one used for Selective Repeat ARQ. It is a NAK that can be used in Go-Back-N ARQ to improve
the efficiency of the process by informing the sender, before the sender timer expires, that the last frame
is lost or damaged. The value of N(R) is the negative acknowledgment number.
• Selective reject (SREJ). If the value of the code subfield is 11, it is an SREJ Sframe. This is a NAK frame
used in Selective Repeat ARQ. Note that the HDLC Protocol uses the term selective reject instead of
selective repeat. The value of N(R) is the negative acknowledgment number.

26
HLDC – Framing – Control
field

7 6 5 4 3 2 1 0
S-Frame

2 1 0 N(R), acknowledgment number (ACK) or negative


acknowledgment number (NAK).

27
HLDC – Framing – Control
field

U-Frame

Unnumbered frames are used to exchange session


management and control information between
connected devices.
contain an information field, but one used for system
management information, not user data

28
HLDC – Framing – Control
field

U-Frame- control field

a 2-bit prefix before the P/F bit and a 3-bit suffix after
the P/F bit. Together, these two segments (5 bits) can be
used to create up to 32 different types of U-frames.

29
Examples

Node A asks for a connection


with a set asynchronous balanced
mode (SABM) frame; node B
gives a positive response with an
unnumbered acknowledgment
(UA) frame. After these two
exchanges, data can be
transferred between the two
nodes (not shown in the figure).
After data transfer, node A sends
a DISC (disconnect) frame to
release the connection; it is
confirmed by node B responding
with a UA (unnumbered
acknowledgment).

30
Examples

two exchanges
using
piggybacking

31
Layer 2 Leased Lines with HDLC

Cisco-specific version of HDLC

Both the Address and Control fields had important


purposes in years past, but today they are unimportant
[1]

32
Layer 2 Leased Lines with HDLC

a leased line with HDLC creates a WAN link between


two routers so that they can forward packets for the
devices on the attached LANs.

33
Implementing Leased Lines with
HDLC

34
Implementing Leased Lines with
HDLC

show running-config
show controllers serial 0/0/0
show interfaces s0/0/0
show ip interface brief
show interfaces description
35
PPP

Today, millions of Internet users who need to connect


their home computers to the server of an Internet
service provider use PPP. The majority of these users
have a traditional modem; they are connected to the
Internet through a telephone line, which provides the
services of the physical layer. But to control and
manage the transfer of data, there is a need for a
point-to-point protocol at the data-link layer.

36
PPP - services

defines the format of the frame to be exchanged between devices


defines how two devices can negotiate the establishment of the link
and the exchange of data
PPP is designed to accept payloads from several network layers
(not only IP).
Authentication is also provided in the protocol, but it is optional
does not provide flow control
A CRC field is used to detect errors If the frame is corrupted, it is
silently discarded

37
PPP - Framing

PPP uses a character-oriented (or byte-oriented) frame

Flag 01111110
The address field in this protocol is a constant value and set to 11111111 (broadcast address).
This field is set to the constant value 00000011
The protocol field defines what is being carried in the data field

38
PPP - Framing

PPP uses a character-oriented (or byte-oriented) frame

Payload field. This field carries either the user data or other information.
• The data field is a sequence of bytes with the default of a maximum of 1500 bytes; but
this can be changed during negotiation.
• byte-stuffed if the flag byte pattern appears in this field
• Because there is no field defining the size of the data field, padding is needed if the size
is less than the maximum default value or the maximum negotiated value.
FCS. The frame check sequence (FCS) is simply a 2-byte or 4-byte standard CRC

39
PPP

Byte Stuffing: The escape byte is 01111101


Transition Phases:

40
PPP

Transition Phases:
When one of the two nodes starts the communication, the
connection goes into the establish state
• If the two parties agree that they need authentication (for example, if they
do not know each other), then the system needs to do authentication
• otherwise, the parties can simply start communication.

Data transfer takes place in the open state.


• The connection remains in this state until one of the endpoints wants to
terminate the connection.

The system remains in the terminate state until the carrier (physical-
layer signal) is dropped, which moves the system to the dead state
again.

41
PPP - Multiplexing

PPP uses another set of protocols to establish the link,


authenticate the parties involved, and carry the network-
layer data.

• Link Control Protocol (LCP)


• Two Authentication Protocols (APs)
• several Network Control Protocols (NCPs)

At any moment, a PPP packet can carry data from one


of these protocols in its data field.

42
PPP - Multiplexing

43
PPP

Link Control Protocol (LCP) is responsible for


establishing, maintaining, configuring, and
terminating links.

44
PPP - Link Control Protocol
(LCP)

There are three categories of packets.

for link configuration during


the establish phase

for link termination during


the termination phase

for link monitoring and


debugging.

45
PPP - Link Control Protocol
(LCP)

The ID field holds a value that matches a request


with a reply. One endpoint inserts a value in this field,
which will be copied into the reply packet.

46
PPP - Link Control Protocol
(LCP)

The length field defines the length of the entire LCP packet.

The information field contains information, such as options, needed for


some LCP packets.

47
PPP - Link Control Protocol
(LCP)

The information field contains information, such as


options.
• information field is divided into three fields:
•option type
•option length
•option data

48
PPP - Authentication Protocols

• Authentication protocols are used during the authentication phase.


• There are two types:
• PAP
• CHAP

Password Authentication Protocol (PAP)


• The user who wants to access a system sends an authentication
identification (usually the user name) and a password
• The system checks the validity of the identification and password
and either accepts or denies connection.

49
PPP - Authentication Protocols

Password Authentication Protocol (PAP)


authenticate-request is used by the user
to send the user name and password.

authenticate-ack is used by the system


to allow access

authenticate-nak is used by the system


to deny access.

50
PPP - Authentication Protocols

• Authentication protocols are used during the authentication phase.

Password Authentication Protocol


• The user who wants to access a system sends an authentication
identification (usually the user name) and a password
• The system checks the validity of the identification and password
and either accepts or denies connection.
Challenge Handshake Authentication Protocol

51
PPP - Authentication Protocols

Challenge Handshake Authentication Protocol (CHAP) is a


three-way handshaking authentication protocol that provides
greater security than PAP.

1. The system sends the user a challenge packet containing a challenge


value
2. The user applies a predefined function that takes the challenge value
and the user’s own password and creates a result. The user sends the
result in the response packet to the system.
3. The system applies the same function to the password of the user (known
to the system) and the challenge value to create a result. If the result
created is the same as the result sent in the response packet, access is
granted; otherwise, it is denied.

52
Marco A. Ortiz N.

PPP - Authentication Protocols

CHAP

53
PPP - Network Control Protocols

PPP has defined a specific Network Control Protocol


for each network protocol.

• One NCP protocol is the Internet Protocol Control Protocol


(IPCP). This protocol configures the link used to carry IP
packets in the Internet.

54
PPP - Network Control Protocols

IPCP

55
PPP

After the network-layer configuration is completed


by one of the NCP protocols, users can exchange data
packets from the network layer

56
PPP - Example

57
References
W. Odom, Cisco Cisco CCNA Rounting and Switching ICND2
200-101: Academic Edition, USA: Pearson Education, 2013,
pp. 621.
• Ch. 12, 13, 14

Forouzan, Data Communications and Networking, 5ed. NY,


USA: McGraw-Hill, 2013, pp. 1226.
• Sec. 14.4

L. Peterson, and B. Davie, Computer Network: a systems


approach, 5ed. Burlington, USA: Elsevier, 2012, pp. 884.
• Sec. 3.1.2

58

You might also like