Вы находитесь на странице: 1из 45

CCNA 1: An Introduction to

Networking
Week 04, Unit 05:
The Data Link & Physical Layers
(Ethernet)
The Data Link & Physical Layers
Learning Objectives

• Explain the purpose, layers, and functions of each layer in the Open
Systems Interconnect (OSI) Model
• Explain the purpose and functionality of the Data Link layer,
including its sub layers
• Explain the purpose and functionality of the Physical layer
• Explain the purpose and functionality of Ethernet
• Explain the concept and purpose of framing packets
• Identify and explain the role of the key fields in a Data Link frame
• Explain the purpose of ARP and contrast its operations with how
PING and TRACE ROUTE locate hosts on a network

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 2


Why the Data Link Layer

• According to Wikipedia (in part):


“The data link layer provides the functional and procedural means to
transfer data between network entities and might provide the means
to detect and possibly correct errors that may occur in the physical
layer. Examples of data link protocols are Ethernet for local area
networks (multi-node), the Point-to-Point Protocol (PPP), HDLC and
ADCCP for point-to-point (dual-node) connections.”
• In plain English:
“The data link layer creates frames and readies them to be converted
into energy for transport over the media, whatever that media might
be. It also may be able to remedy errors in energy it receives so that
the communication is successful. Ethernet is a key Data Link layer
protocol and we will discuss it in this unit.”
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 3
Why the Physical Layer
• According to Wikipedia (in part):
“The physical layer defines the means of transmitting raw bits rather
than logical data packets over a physical link connecting network
nodes. The bit stream may be grouped into code words or symbols
and converted to a physical signal that is transmitted over a
hardware transmission medium. The physical layer provides an
electrical, mechanical, and procedural interface to the transmission
medium. The shapes and properties of the electrical connectors, the
frequencies to broadcast on, the modulation scheme to use and
similar low-level parameters, are specified here.”
• In plain English:
“The physical layer creates the energy that will be transmitted as bits
over the media in a format that saves time and bandwidth.”

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 4


Networking Logical Models

• Devices and software mapped to logical model to


use OS functionality
• Many OS services load when computer boots
• OS services are applications that are always running in
the background of the OS
• Logical model not an actual program
• A series of “layers” that define functionality
• OSI (Open Systems Interconnection) model defines
how network hardware and software operate

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 5


The OSI Model

• Model comprised of seven logical layers


• Application (7), Presentation (6), Session (5), Transport
(4), Network (3), Data Link (2), Physical (1)
• Each layer’s communication is standardized so
adjacent layers know how to communicate with
each other
• Device and software communication is
standardized using OS services
• Depending on device and/or software, one service calls
on the functionality of another service to facilitate
network functionality
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 6
A Preview!
OSI OSI Layer Encapsulation Devices or
TCP/IP Protocols Keywords/Description
Layer # Name Units Components

Network services for application


Application processes, such as file, print,
FTP, HTTP, POP3, IMAP, telnet, messaging, database services
7 data PC
SMTP, DNS, TFTP
(Away)

Standard interface to data for the


Presentation application layer. MIME encoding,
data encryption, conversion,
6 data formatting, compression
(Pizza)

Interhost communication.
Session data Establishes, manages and
terminates connection between
5 applications
(Sausage) (Drippy)

End-to-end connections and


Transport segments reliability.
Segmentation/desegmentation of
4 TCP, UDP data in proper sequence. Flow
(Throw) (Sweet) control

Logical addressing and path


Network packets determination. Routing. Reporting
delivery errors
3 router IP
(not) (Pancakes)

Physical addressing and access to


Data Link frames media. Two sublayers: Logical
Link Control (LLC) and Media
2 bridge, switch, NIC Access Control (MAC)
(Do) (For)

Binary transmission signals and


Physical bits encoding. Layout of pins,
voltages, cable specifications,
1 repeater, hub, tranceiver modulation
(Please) (Breakfast)

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 7


OSI Model Layer 7: Application
Layer
• Network-aware software on a device calls on OS
services to begin the network communication
process by converting the software’s
communication into a format that can be readied
for transmission
• You click “send” on an e-mail to start this process
• The communication is called data at this level

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 8


OSI Model Layer 6: Presentation
Layer
• Takes the converted message and further
transforms it for electronic transmission
• Also handles file compression and/or encryption
if the file is or needs to be encrypted
• If your e-mail is a compressed file, the compression
type used, etc. is handled here
• The communication is still called data at this level

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 9


OSI Model Layer 5: Session Layer

• Manages asynchronous application-to-


application communication.
• You send an e-mail to your friend. Services here
record that an e-mail program needs to receive this
communication (and vice-versa)
• The communication is still called data at this level

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 10


OSI Model Layer 4: Transport
Layer
• Manages asynchronous device-to-device
communication
• When sending an e-mail, services here indicate where a
file (and communication) begins
• When receiving an e-mail, they indicate where a file ends
and when the communication process should be
considered complete
• Also ensures that pieces of the communication are put in
the right order (sending and receiving)
• The communication is called a segment at this level and
is encoded with information about the communication
and instructions
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 11
OSI Model Layer 3: Network Layer

• Manages asynchronous network-to-network


communication
• Services prepare the packet for transport by adding a
header and trailer to each packet
• Services inform receiving devices as to the packet’s
source, destination, protocol, etc.
• The communication is called a packet at this level
since services split the segment into manageable
sizes and further encode each packet with information
to be used by Layer 3 devices (routers)

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 12


OSI Model Layer 2: Data Link
Layer
• Determines applicable networking protocols for
this packet and at the same time readies the
packet for transport using whatever media is
supported by the NIC (Ethernet, wireless, fiber
optic)
• E-mail will be sent using the SMTP (Simple Mail
Transfer Protocol) via IPv4
• The computer’s NIC uses copper cable and expects
the communication to be encoded according to the
Ethernet standard
• The communication is called a frame at this level
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 13
OSI Model Layer 1: Physical Layer

• NIC takes the computer’s digital electronic signal


and transforms it into a signal that can be placed
on the NIC’s media
• The e-mail is translated into electronic impulses and
moved from the NIC to the wires at the end of the RJ-
45 and pushed across the entire cable length to the
next device (which is usually a switch or router)
• The communication is called bits at this level

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 14


Mnemonics Help to
Memorize Layer Order
• Easy to remember OSI model layer order using
mnemonics. Review of order…
• Application (7), Presentation (6), Session (5),
Transport (4), Network (3), Data Link (2), Physical (1)
• Top to bottom:
• All People Standing Totally Naked Don’t Perspire
• Bottom to top:
• Please Do Not Teach Students Phony Acronyms

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 15


Mnemonics Help to Memorize
Communication Name Order
• Easy to remember what to call the data too:
• Data -> Segment -> Packet -> Frame -> Bits
• Drippy Sweet Pancakes For Breakfast
• Segments created by encapsulating data inside,
appended by header [no trailer]
• Packets created by encapsulating segment inside,
appended by header & trailer
• Frame created by encapsulating packet inside,
appended by header & trailer
• Bits created by encoding frame into electronic
impulses, radio waves, or photons (0’s & 1’s)
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 16
Devices & the OSI Model

• Devices operate at specific layers:


• Layer 4 (and higher!) - security routers
• Layer 3 – routers, and switches that also function as a
router (known as a “L3 switch”)
• Layer 2 – switches and most NIC functionality
• Layer 1 – hubs, some NIC functionality, network
cabling, wireless antennae

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 17


What is an Ethernet Frame?

• Logical construct contains L2 header, packet


from L3, & L2 trailer
• Preceded by preamble & delimiter
• Entire packet encapsulated as “payload”
• Trailer made up of frame check sequence (FCS)
• Frame standardized by IEEE

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 18


Ethernet Frame Fields

• Preamble & Start Frame field


• Announces beginning of a new frame
• Source and Destination address fields
• Source and destination MAC addresses for frame
• 802.1q field
• Usually identifies the frame’s VLAN number
• EtherType or Length field
• Identifies L3 protocol in frame’s payload
• IPv4 EtherType code is 0x800
• IPv6 EtherType code is 0x86DD
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 19
Application Layer Apps & Services

• Network-aware applications
• Software people use to access the Internet
• Cloud apps, e-mail, browser are examples
• Application layer services
• OS programs that assist network-aware apps
• Network-aware apps “call” on these services to
access the Internet

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 20


Clients, Servers, & Peers

• Clients request data from servers


• Web browser requests webpage from Web server
• Servers provide data to clients
• Web server returns webpage HTML via HTTP to client
• Peers can act as client &/or server
• User logged into Web server prints a page via a Print
server
– Web server both client & server as it serves up webpages
and requests print jobs

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 21


MAC Addressing
• Address stamped on
NIC by vendor
• Identifies this NIC
physically
• First half of MAC
address reveals vendor
• Last half a random
number that vendor
selects from pool
– 00-16-E6 for NIC vendor
named GIGABYTE

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 22


MAC Addressing (cont’d)

• Called the physical address


• Not an hierarchical address
• Cannot be used to segment network since numbers
have no ordered meaning
• Only has meaning in LAN where host resides
• If packet must leave LAN
• Source MAC is host sending frame
• Destination MAC is MAC address of default gateway

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 23


Layers Within a Layer!

• Data Link layer can be viewed as one layer with


two sub-layers
• Logical Link Control (upper)
– Functionality depends on L3 protocol received from L3
– Standardizes frame for MAC layer below
• Media Access Control (lower)
– Functionality depends on NIC technology
– Wired, wireless, or fiber signaling requirements
• Works in both software & hardware
• NIC’s driver & OS
• Circuitry on NIC motherboard
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 24
Data Link & its Sub-layers

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 25


Media Access Control

• Manages placement of frames onto the media


• Shared vs. unshared media important
• Shared media means devices need protocol to
determine who uses media, when, & error process
• Unshared media like point-to-point connections avoid
all of that overhead
• Two types of media access control for shared
media:
• Controlled – usually ring type topology
• Contention-based – Ethernet or wireless topology
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 26
CSMA – Huh?
• Shared media means anyone can use media at
any time
• Hosts “contend” for the media & somehow must
negotiate its use
• Carrier Sense Multiple Access with Collision
Detection (CSMA/CD)
• NIC monitors media for sense of signal
• Places bits on media when no signal sensed
• Detects collision & implements backoff recovery
algorithm when necessary

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 27


CSMA – Huh? (Part 2)
• Shared media means anyone can use media at
any time (no change)
• Devices “contend” for the media & must negotiate its
use somehow (no change)
• Carrier Sense Multiple Access with Collision
Avoidance (CSMA/CA) (changes here!)
• NIC monitors media for sense of signal
• Sends advance signal to network to warn other NICs
• Places bits on media when no signal sensed
• Detects collision & implements backoff recovery
algorithm
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 28
Collision Domains
• Routers create broadcast domains per port
• Switches create collision domains per port

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 29


Framing the Frame

• Frame made up of three basic parts:


• Header
• Data
• Trailer
• Frame structure varies depending on media
• Ethernet frame
• Point-to-point frame
• Wireless frame

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 30


Frame Addressing

• Multi-access & ring topologies


• Source/destination addressing
required
• Frame sent to each NIC in LAN
• Each NIC examines destination
MAC address
– Discards frame if destined for
different MAC address
• Point-to-Point topologies
• Frame only has one physical
destination
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 31
L2 vs. L3 Addressing

• Layer 3 address is hierarchical


• IP addressing is in the packet
– Packet encapsulated in frame as data
• IP address identifies host’s actual network location
• IP address called a logical address
• Layer 2 address not hierarchical
• Frame only useful in LAN
• MAC address has no meaning outside of LAN
• MAC address called a physical address

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 32


Frames on the Media

• Frames sent to LAN devices stay in LAN


• Frames sent outside of LAN pass through
default gateway:
• Switch receives frame but cannot find destination L2
address in LAN
• Switch forwards frame to default gateway
– Switch places router’s MAC address In frame’s destination
address field
• Router receives frame & decapsulates it to reveal the
packet
• Router reads destination L3 address & routes packet
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 33
What is a Trailer?

• All frames possess a trailer as the last frame


field
• Trailer contains Frame Check Sequence field
• Contains Cyclic Redundancy Check checksum value
• Checksum value created to verify bits in frame
• Each destination device runs CRC algorithm to
recalculate checksum value
• If checksum value not exactly the same, frame is
discarded and not forwarded
• Anyone can change CRC value with hacker tools
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 34
Point-to-Point Protocol Frames

• PPP frames created when two devices are


directly connected to each other
• Ethernet, fiber, serial, etc.
• PPP is a WAN protocol
• Encapsulates any L3 packet for transport
• PPP topology & frame:

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 35


802.11 Wireless Frames

• Somewhat similar to Ethernet frame format


• Wireless media relies on CSMA/CA
• Older (not N+) wireless topologies are half-duplex
• APs ACK each frame received
• Obviously adds/changes fields for wireless:
 Devices authenticate to wireless access point (WAP)
 Frame might be encrypted (often is)
 Wireless has its own control frames

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 36


What the Heck is HEX?

• Different than binary


• Hexadecimal is a Base 16 number system
• Allows 4-bits to be expressed in 1-character
• Valid numbers are 0 through 15
• Numbers 10 through 15 expressed as A through F
respectively
• Hex numbers usually begin with “”0x”
• For example: 0x0021

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 37


More about Hexadecimal

• Each hex character represents 4-bits


• The hex number 0x0021 represents 16-bits
• 4-bits called a “nibble”
• 8-bits called a “byte”
• Translating between Hex -> Binary -> Decimal
not too difficult
• Each hex character translated independently of other
hex characters, then joined together to create binary
number
• Then convert binary to decimal
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 38
Hex Conversion Example

• The hex number 0x0021:


• Start from left:
• 0 = 0000
• 0 = 0000
• 2 = 0010
• 1 = 0001
• Binary equivalent of 0x0021 is:
• 0000000000100001b
• Decimal equivalent of 0x0021 is:
• 33

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 39


How is Hex used?
• IPv6 addresses are all hexadecimal
• L2 MAC addresses are all hexadecimal
• Computer memory locations are all hexadecimal
• Practice conversions!
• Convert these decimal numbers to hex:
• 2048, 18421, 255, 6
• Convert these hex characters to binary:
• FEC0, FFFF, ABCD, 94F3
• Check with instructor for answers
• Use Windows Calculator to verify answers too!
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 40
Address Resolution Protocol
• Each host maintains a L2 to L3 address
mapping for its LAN
• Use command-line ARP with –a switch
command on your PC to view your mappings:

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 41


ARP vs ICMP
• ARP only maps L2 MAC address to L3 IP
address
• Can’t physically locate host based on L2 address
• L2 address only used in LAN frame
• ICMP locates host based on L3 address
• Ping uses L3 address to determine if destination host
can communicate on network
• Traceroute uses L3 address to trace path from source
to destination
– Many routers are configured to ignore ICMP messages and
give the impression that they are not “up”

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 42


The Data Link & Physical Layers
Summary – Unit 10
• Explain the purpose and functionality of the Data Link
layer, including its sub layers
• Explain the purpose and functionality of the Physical layer
• Explain the purpose and functionality of Ethernet
• Explain the concept and purpose of framing packets
• Identify and explain the role of the key fields in a Data
Link frame
• Explain the purpose of ARP and contrast its operations
with how PING and TRACE ROUTE locate hosts on a
network
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 43
The Data Link & Physical Layers
References – Unit 10
References
• Odem, W. Cisco CCENT/CCNA ICND1 Academic Edition. 1st ed. Indianapolis: Cisco Press; 2013.
• Odem, W. Cisco CCENT/CCNA ICND1 100-101. 1st ed. Indianapolis: Cisco Press; 2013.
• Odem, W. Cisco CCNA ICND2 200-101. 1st ed. Indianapolis: Cisco Press; 2013.
• Dean, T. Network+ Guide to Networks. 6th ed. Boston. Course Technology; 2012.
• Data link layer. Wikipedia [free encyclopedia on the Internet]. 2013 July 03; [cited 08 July 13]; Available from:
https://en.wikipedia.org/wiki/Data_link_layer.
• Physical layer. Wikipedia [free encyclopedia on the Internet]. 2013 June 11; [cited 08 July 13]; Available from:
https://en.wikipedia.org/wiki/Physical_layer.
• Ethernet frame (networking). Wikipedia [free encyclopedia on the Internet]. 2013 May 13; [cited 08 July 13];
Available from: https://en.wikipedia.org/wiki/Ethernet_frame.
• EtherType (networking). Wikipedia [free encyclopedia on the Internet]. 2013 June 20; [cited 08 July 13]; Available
from: https://en.wikipedia.org/wiki/EtherType.
• Carrier sense multiple access with collision detection (networking). Wikipedia [free encyclopedia on the Internet].
2013 June 01; [cited 08 July 13]; Available from:
http://en.wikipedia.org/wiki/Carrier_sense_multiple_access_with_collision_detection.
• Carrier sense multiple access with collision avoidance (networking). Wikipedia [free encyclopedia on the Internet].
2013 June 01; [cited 08 July 13]; Available from:
http://en.wikipedia.org/wiki/Carrier_sense_multiple_access_with_collision_avoidance.
• Point-to-Point (PPP) Protocol Field Assignments. Internet Assigned Numbers Authority (IANA). 2012 Nov 19;
[cited 08 July 13]; Available from: http://www.iana.org/assignments/ppp-numbers/ppp-numbers.xhtml.

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 44


The Data Link & Physical Layers
References – Unit 10
References
• Point-to-point protocol. Wikipedia [free encyclopedia on the Internet]. 2013 June 23; [cited 08 July 24]; Available
from: https://en.wikipedia.org/wiki/Point-to-point_protocol.
• IEEE 802.11 [free encyclopedia on the Internet]. 2013 July 13; [cited 13 July 24]; Available from:
http://en.wikipedia.org/wiki/IEEE_802.11.
• Address Resolution Protocol [free encyclopedia on the Internet]. 2013 July 17; [cited 13 July 24]; Available from:
http://en.wikipedia.org/wiki/Address_Resolution_Protocol.

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 45