Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

LAYER 2 DATA LINK

MAC ADDRESSING
ETHERNET FRAME
Sublayers
 LLC – Logical Link Control 802.2 (implemented
in software) – services for upper layers, flow
control
 MAC – Media Access Control controls how
devices access the medium.
 Host addressing
 Layer 2 framing – (de) encapsulating
 Half-duplex transmission
 Frame check sequence, discarding frames, start
frame delimiter, preamble
MAC
 The devices can access the medium by:
 -CSMA/CD - Colision Detection
 -CSMA/CA - Collision Avoidance
 -Token Ring – Collision Free
CSMA/CD designed for
 802.3 – ethernet NIC senses for a carrier signal,
and if two hosts are listening at the same time,
and send at the same time there might be
collisions and CSMA/CA is designed for this
 Shared media – bus networks, hub (collisions)
 Identify devices – MAC Addresses
 Resolving collisions
CSMA/CD Steps
 Sense: when a device wants to send a frame
waits until there is no carrier signal
 Send: begin sending
 Listen: continue listening for collisions
 Collision : it occurs - the device sends a jam
signal to notify all the signals to stop listening
 Wait each sending device runs an algorithm to
set random waiting time
 Resend: after the wait expires it sends again
MAC ADDRESS
 48 BIT address hexadecimal (12 hexa)
 1 hexa = 1 nibble = 4 bits

 2F-AC-04-DF-11-04 is an example

 First half is the organizational unique identifier

 Second half vendor assigned portion

- So the first part is the producer, and the second


half is unique for every NIC
ETHERNET FRAME FORMAT
 PREAMBLE – and Start frame delimiter
 Preamble = 7 bytes (they show a frame is about
to be sent) last byte the SFD the last byte before
the frame starts
 Destination MAC, Source MAC
 TYPE
 - IPv4 0X0800
 - IPv6 0x86DD
 - ARP 0X0806
 Between the ether type and source mac we introduce the tag
protocol identifier – 2 bytes – who shows for example if it has a
802.1q tag = 0x8100
IPV6
 128 bit (8 hextets)
 Link-local address on each interface (locally
significant only, it is not routable)
The routable addresses are:
 Global Unicast unicast - routable on the internet
 Unique local – unicast (IPv4 private address)
 Anycast – same unicast on multiple devices
Network prefix (mask)
 Global unicast / 64
 Link-local / 10
 The network prefix is the network part, 64 bits,
and the Interface ID is the host.
 First 3 bits – IANA (numbers authority) global prefix
 3-23 bits – regional registry (country)
 23-32 – provider prefix
 32-48 – site prefix
 48-64 – subnet prefix
The compression

 Leading zeros: 0001 = 1 0010 = 10 0100 = 100


 And continuous zeros: 0000: 0000 : 0000 = : :
 You can only do this once
ICMPv6
 ICMP was firstly introduced in 1981, it is an auxiliary
protocol for IPv4, it is a layer 3 protocol.
 It is used by network devices, including routers, to
send error messages and operational information
indicating success or failure when communicating
with another IP address.
 ICMPv6 has several extensions, such as Network
Discovery Protocol.
 An error example would be:
 Type 1 - destination unreachable 0000 0001
 Code 4 -port unreachable 0000 0100
Network Discovery Protocol
Network Discovery Protocol

 Router Solicitation (Type 133)


 Hosts inquire with Router Solicitation messages to locate
routers on an attached link. Routers which forward packets
not addressed to them generate Router Advertisements
immediately upon receipt of this message rather than at
their next scheduled time.
 Router Advertisement (Type 134)
 Routers advertise their presence together with various link
and Internet parameters either periodically, or in response
to a Router Solicitation message.
 Neighbor Solicitation (Type135) (Code 0)
 Neighbor solicitations are used by nodes to
determine the link layer address of a neighbor, or
to verify that a neighbor is still reachable via a
cached link layer address.
 Neighbor Advertisement
 (Type 136) Neighbor advertisements are used by
nodes to respond to a Neighbor Solicitation
message.
 Redirect (Type 137)Routers may inform hosts of a
better first hop router for a destination.
IPv6 SLAAC
 1. Router solicitation
 2. Router advertisment
 3. AUTOCONFIGURE OR EUI-64
 4. DAD (Duplicate address detection)
How it actually works (Part 1)
 First of all the host sends a router solicitation
(source address is empty : : /128 because the
host doesn’t have an address) and the
destination address is FF02::2 (all routers
multicast) the type is 133 because is ICMPv6
code for this.,
Part 2
 The router then replies with a Router
Advertisment. The addresses now are the
source of the Router fe80::x (router link-local),
and the destination address is all nodes
multicast ff02::1 type 134.
 after that the interface will be completed by the
host with 2 methods (windows 10 - random) or
EUI-64, (in the middle of the MAC, inserts

You might also like