Data Link Layer5-1 Link Layer and LANs Partly adapted from slides for Computer Networking: A Top...
-
Upload
lorraine-barrett -
Category
Documents
-
view
224 -
download
0
Transcript of Data Link Layer5-1 Link Layer and LANs Partly adapted from slides for Computer Networking: A Top...
Data Link Layer 5-1
Link Layer and LANs
Partly adapted from slides for Computer Networking A Top Down Approach 5th edition Jim Kurose Keith Ross Addison-Wesley April 2009
Internet protocol stack
application supporting network applications FTP SMTP HTTP
transport process-process data transfer TCP UDP
network routing of datagrams from source to destination IP routing protocols
link data transfer between neighboring network elements Ethernet 802111 (WiFi) PPP
physical bits ldquoon the wirerdquo
application
transport
network
link
physical
Zhang Net Admin Spring 2012
source
application
transportnetwork
linkphysical
HtHn M
segment Ht
datagram
destination
application
transportnetwork
linkphysical
HtHnHl M
HtHn M
Ht M
M
networklink
physical
linkphysical
HtHnHl M
HtHn M
HtHn M
HtHnHl M
router
switch
Encapsulationmessage M
Ht M
Hn
frame
Zhang Net Admin Spring 2012
layer-2 packet is a frameencapsulates datagram
Data Link Layer 5-4
Link Layer Terminology
Nodes hosts and routers Links communication
channels that connect adjacent nodes along communication path wired or wireless links
data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link
Data Link Layer 5-5
Where is the link layer implemented in each and every node link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card PCMCI card
80211 card implements link physical
layer attaches into hostrsquos
system buses combination of
hardware software (driver) firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Data Link Layer 5-6
Adaptors Communicating
sending side encapsulates datagram
in frame adds error checking bits
rdt flow control etc
receiving side looks for errors rdt flow
control etc extracts datagram passes
to upper layer at receiving side
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layer 5-7
Two types of ldquolinksrdquo
point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
router
Point-to-point link
Outline General link layer topics
Service Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-8
Ethernet 80211 WiFi
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Internet protocol stack
application supporting network applications FTP SMTP HTTP
transport process-process data transfer TCP UDP
network routing of datagrams from source to destination IP routing protocols
link data transfer between neighboring network elements Ethernet 802111 (WiFi) PPP
physical bits ldquoon the wirerdquo
application
transport
network
link
physical
Zhang Net Admin Spring 2012
source
application
transportnetwork
linkphysical
HtHn M
segment Ht
datagram
destination
application
transportnetwork
linkphysical
HtHnHl M
HtHn M
Ht M
M
networklink
physical
linkphysical
HtHnHl M
HtHn M
HtHn M
HtHnHl M
router
switch
Encapsulationmessage M
Ht M
Hn
frame
Zhang Net Admin Spring 2012
layer-2 packet is a frameencapsulates datagram
Data Link Layer 5-4
Link Layer Terminology
Nodes hosts and routers Links communication
channels that connect adjacent nodes along communication path wired or wireless links
data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link
Data Link Layer 5-5
Where is the link layer implemented in each and every node link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card PCMCI card
80211 card implements link physical
layer attaches into hostrsquos
system buses combination of
hardware software (driver) firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Data Link Layer 5-6
Adaptors Communicating
sending side encapsulates datagram
in frame adds error checking bits
rdt flow control etc
receiving side looks for errors rdt flow
control etc extracts datagram passes
to upper layer at receiving side
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layer 5-7
Two types of ldquolinksrdquo
point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
router
Point-to-point link
Outline General link layer topics
Service Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-8
Ethernet 80211 WiFi
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
source
application
transportnetwork
linkphysical
HtHn M
segment Ht
datagram
destination
application
transportnetwork
linkphysical
HtHnHl M
HtHn M
Ht M
M
networklink
physical
linkphysical
HtHnHl M
HtHn M
HtHn M
HtHnHl M
router
switch
Encapsulationmessage M
Ht M
Hn
frame
Zhang Net Admin Spring 2012
layer-2 packet is a frameencapsulates datagram
Data Link Layer 5-4
Link Layer Terminology
Nodes hosts and routers Links communication
channels that connect adjacent nodes along communication path wired or wireless links
data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link
Data Link Layer 5-5
Where is the link layer implemented in each and every node link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card PCMCI card
80211 card implements link physical
layer attaches into hostrsquos
system buses combination of
hardware software (driver) firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Data Link Layer 5-6
Adaptors Communicating
sending side encapsulates datagram
in frame adds error checking bits
rdt flow control etc
receiving side looks for errors rdt flow
control etc extracts datagram passes
to upper layer at receiving side
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layer 5-7
Two types of ldquolinksrdquo
point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
router
Point-to-point link
Outline General link layer topics
Service Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-8
Ethernet 80211 WiFi
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-4
Link Layer Terminology
Nodes hosts and routers Links communication
channels that connect adjacent nodes along communication path wired or wireless links
data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link
Data Link Layer 5-5
Where is the link layer implemented in each and every node link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card PCMCI card
80211 card implements link physical
layer attaches into hostrsquos
system buses combination of
hardware software (driver) firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Data Link Layer 5-6
Adaptors Communicating
sending side encapsulates datagram
in frame adds error checking bits
rdt flow control etc
receiving side looks for errors rdt flow
control etc extracts datagram passes
to upper layer at receiving side
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layer 5-7
Two types of ldquolinksrdquo
point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
router
Point-to-point link
Outline General link layer topics
Service Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-8
Ethernet 80211 WiFi
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-5
Where is the link layer implemented in each and every node link layer implemented
in ldquoadaptorrdquo (aka network interface card NIC) Ethernet card PCMCI card
80211 card implements link physical
layer attaches into hostrsquos
system buses combination of
hardware software (driver) firmware
controller
physicaltransmission
cpu memory
host bus (eg PCI)
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Data Link Layer 5-6
Adaptors Communicating
sending side encapsulates datagram
in frame adds error checking bits
rdt flow control etc
receiving side looks for errors rdt flow
control etc extracts datagram passes
to upper layer at receiving side
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layer 5-7
Two types of ldquolinksrdquo
point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
router
Point-to-point link
Outline General link layer topics
Service Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-8
Ethernet 80211 WiFi
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-6
Adaptors Communicating
sending side encapsulates datagram
in frame adds error checking bits
rdt flow control etc
receiving side looks for errors rdt flow
control etc extracts datagram passes
to upper layer at receiving side
controller controller
sending host receiving host
datagram datagram
datagram
frame
Data Link Layer 5-7
Two types of ldquolinksrdquo
point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
router
Point-to-point link
Outline General link layer topics
Service Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-8
Ethernet 80211 WiFi
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-7
Two types of ldquolinksrdquo
point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
router
Point-to-point link
Outline General link layer topics
Service Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-8
Ethernet 80211 WiFi
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Outline General link layer topics
Service Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-8
Ethernet 80211 WiFi
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-9
Link Layer Services framing link access
encapsulate datagram into frame adding header trailer Multiple channel access if shared medium ldquoMACrdquo addresses used in frame headers to identify source
dest error detectioncorrection (without retransmission) reliable delivery between adjacent nodes
seldom used on low bit-error link flow control
pacing between adjacent sending and receiving nodes half-duplex and full-duplex
with half duplex nodes at both ends of link can transmit but not at same time
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
MAC Addresses and ARP
MAC (or LAN or physical or Ethernet) address function get frame from one interface to another
physically-connected interface (same network) 48 bit MAC address (for most LANs)
bull burned in ROM allocation administered by IEEE
bull manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another IP hierarchical address NOT portable
address depends on IP subnet to which node is attached
Data Link Layer 5-10
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-11
LAN Addresses and ARPEach adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-12
ARP Address Resolution Protocol
Each IP node (host router) on LAN has ARP table IPMAC address
mappings for some LAN nodes
lt IP address MAC address TTLgt
bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)
Question how to determineMAC address of Bknowing Brsquos IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-13
ARP protocol Same LAN (network) A wants to send datagram
to B and Brsquos MAC address not in Arsquos ARP table
A broadcasts ARP query packet containing Bs IP address dest MAC address = FF-
FF-FF-FF-FF-FF all machines on LAN
receive ARP query B receives ARP packet
replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state information
that times out (goes away) unless refreshed
ARP is ldquoplug-and-playrdquo nodes create their ARP
tables without intervention from net administrator
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Linux command arp
used to create modify display or delete ARP table entries on the devicearp -e - Display all ARP table entries (for all interfaces)
arp -en - Display all ARP table entries (for all interfaces) but do not resolve IP addresses to host names
arp -d 1111 - Delete the ARP table entry for host 1111
arp -i eth0 -s 1111 A123ABCF321A - Create a static ARP table entry associating IP address 1111 with MAC address A123ABCF321A available through eth0 interface
Data Link Layer 5-14
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-15
Ethernet 80211 WiFi
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-16
Multiple Access Links and Protocols
Two types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and host
broadcast (shared wire or medium) old-fashioned Ethernet 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-17
Multiple Access protocolsProblem single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at same time
Solution multiple access protocol distributed algorithm to determine how nodes share
channel ie determine when node can transmit communication about channel sharing must use channel
itself Three categories
Channel Partition Random Access Take-turn
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-18
MAC Protocols Channel Partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code) allocate piece to node for exclusive use
1 3 4 1 3 4
6-slotframe
frequ
ency
bands time
FDM cable
TDMA
FDMA
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
MAC Protocols Random Access When node has packet to send
transmit at full channel data rate R ie channel not divided
no a priori coordination among nodes two or more transmitting nodes ldquocollisionrdquo random access MAC protocol specifies
how to detect collisions how to recover from collisions (eg via delayed
retransmissions) Examples
slotted ALOHA ALOHA CSMA CSMACD CSMACA
Data Link Layer 5-19
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-20
CSMA (Carrier Sense Multiple Access)
CSMA listen before transmit If channel sensed idle transmit entire frame If channel sensed busy defer transmission
human analogy donrsquot interrupt others
What if two people start to speak at same time CSMACD (Collision Detection) used in wired LAN (where
collisions can be detected within short time)
colliding transmissions aborted reducing channel wastage
human analogy the polite conversationalist
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
MAC Protocols ldquoTaking turnsrdquo nodes take turns but nodes with more
to send can take longer turns channel partitioning MAC protocols efficient
and fair at high load inefficient at low load(1N bandwidth allocated even if only 1 active node)
random access MAC protocols efficient at low load single node can fully utilize channel high load collision overhead
ldquotaking turnsrdquo protocols look for best of both worlds
Data Link Layer 5-21
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-22
ldquoTaking Turnsrdquo MAC protocolsPolling master node
ldquoinvitesrdquo slave nodes to transmit in turn
concerns polling overhead latency single point of
failure (master) Examples Bluetooth
master
slaves
poll
data
data
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-23
ldquoTaking Turnsrdquo MAC protocolsToken passing control token
passed from one node to next sequentially
concerns token overhead latency single point of failure
(token) Examples FDDI
(100 Mbits optical standard for data transmission in a LAN) IBM Token Ring =gt8025 (Token Ring LAN)
T
data
(nothingto send)
T
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-24
Ethernet 80211 WiFi
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-25
Ethernet
ldquodominantrdquo wired LAN technology cheap $20 for NIC first widely used LAN technology simpler cheaper than token LANs and ATM kept up with speed race 10 Mbps ndash 10 Gbps
Metcalfersquos Ethernetsketch
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-26
8023 Ethernet Standards Link amp Physical Layers
many different Ethernet standards common MAC protocol and frame format different speeds 2 Mbps 10 Mbps 100
Mbps 1Gbps 10G bps different physical layer media fiber cable
applicationtransportnetwork
linkphysical
MAC protocoland frame format
100BASE-TX
100BASE-T4
100BASE-FX100BASE-T2
100BASE-SX 100BASE-BX
fiber physical layercopper (twisterpair) physical layer
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-27
Ethernet CSMACD algorithm
1 NIC receives datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2
connectionless No handshaking between sending and receiving NICs unreliable
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-28
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
Preamble used to synchronize receiver sender clock rates 7 bytes with pattern 10101010 followed by one byte with pattern
10101011 Addresses 6 bytes
if adapter receives frame with matching destination address or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol otherwise adapter discards frame
Type higher layer protocol (IP Novell IPX AppleTalk) CRC checked at receiver if error is detected frame is dropped
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-29
Bus topology all nodes in same collision domain (can collide with
each other) popular through mid 90s Hub physical-layer (ldquodumbrdquo) repeaters bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMACD at hub host NICs detect collisions
bus coaxial cable
twisted pair
hub
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-30
Star topology today star topology prevails Switch link-layer device
smarter than hubs take active role store forward Ethernet frames examine incoming framersquos MAC address selectively
forward frame to one-or-more outgoing links when frame is to be forwarded uses CSMACD to access segment
So-called layer-2 switch Transparent
hosts are unaware of presence of switches plug-and-play self-learning
switches do not need to be configured
switch
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-31
Switch Table
multiple simultaneous transmissions Eg A-to-Arsquo and B-to-Brsquo
simultaneously without collisions
Q how does switch know that Arsquo reachable via interface 4 Brsquo reachable via interface 5
A each switch has a switch table each entry (MAC address of host interface to
reach host time stamp) looks like a routing table
A
Arsquo
B
Brsquo
C
Crsquo
switch with six interfaces(123456)
1 23
45
6
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-32
Switch self-learning
switch learns which hosts can be reached through which interfaces when frame received
switch ldquolearnsrdquo location of sender incoming LAN segment
records senderlocation pair in switch table
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-33
Switch frame filteringforwardingWhen frame received
1 record link associated with sending host2 index switch table using MAC dest address3 if entry found for destination
then if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated else flood
forward on all but the interface on which the frame arrived
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-34
Self-learning forwarding example
A
Arsquo
B
Brsquo
C
Crsquo
1 23
45
6
A Arsquo
Source ADest Arsquo
MAC addr interface TTL
Switch table (initially empty)
A 1 60
A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo
frame destination unknownflood
Arsquo A
destination A location known
Arsquo 4 60
selective send
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-35
Interconnecting switches
switches can be connected together
A
B
Q sending from A to G - how does S1 know to forward frame destined to F via S4 and S3
A self learning (works exactly the same as in single-switch case)
S1
C D
E
FS2
S4
S3
H
I
G
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-36
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-37
Switches vs Routers
both store-and-forward devices routers network-layer
devices (examine network-layer headers)
switches are link-layer devices (examine link-layer headers)
routers maintain routing tables implement routing algorithms
switches maintain switch tables implement filtering learning algorithms
application
transportnetwork
linkphysical
networklink
physical
linkphysical
switch
datagram
application
transportnetwork
linkphysical
frame
frame
frame
datagram
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-38
Ethernet 80211 WiFi
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Wireless Mobile Networks 6-39
wireless network
network infrastructure
wireless hosts laptop PDA IP phone run applications may be stationary (non-
mobile) or mobile
base station typically connected to
wired network relay - sending
packets between wired network and wireless host(s) in its ldquoareardquo eg cell towers
80211 access points
wireless link used to connect
mobile(s) to base station
also used as backbone link
multiple access protocol coordinates link access
various data rates transmission distance
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Wireless Mobile Networks 6-40
Wireless Link Characteristics (1)
Differences from wired link hellip
decreased signal strength radio signal attenuates as it propagates through matter (path loss)
interference from other sources standardized wireless network frequencies (eg 24 GHz) shared by other devices (eg phone) devices (motors) interfere as well
multipath propagation radio signal reflects off objects ground arriving ad destination at slightly different times
hellip make communication across wireless link much more ldquodifficultrdquo
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Wireless Mobile Networks 6-41
Characteristics of selected wireless link standards
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m ndash 4 Km
Long-rangeoutdoor
5Km ndash 20 Km
056
384
1
4
5-11
54
IS-95 CDMA GSM 2G
UMTSWCDMA CDMA2000 3G
80215
80211b
80211ag
UMTSWCDMA-HSPDA CDMA2000-1xEVDO 3G cellularenhanced
80216 (WiMAX)
80211ag point-to-point
200 80211n
Dat
a ra
te (
Mbp
s)
data
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Wireless Mobile Networks 6-42
IEEE 80211 Wireless LAN all use CSMACA for multiple access all have base-station and ad-hoc network
versions
network infrastructure
base station
connects mobiles into wired network
80211b 24-5 GHz unlicensed
spectrum up to 11 Mbps
80211a 5-6 GHz range up to 54 Mbps
80211g 24-5 GHz range up to 54 Mbps
80211n multiple antennae 24-5 GHz range up to 200 Mbps
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Wireless Mobile Networks 6-43
80211 LAN architecture wireless host
communicates with base station ie access point (AP)
Basic Service Set (BSS) (aka ldquocellrdquo) contains wireless hosts access point (AP)
80211b 24GHz-2485GHz spectrum divided into 11 channels at different frequencies AP admin chooses
frequency for AP interference possible
channel can be same as that chosen by neighboring AP
BSS 1
BSS 2
Internet
hub switchor routerAP
AP
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Wireless Mobile Networks 6-44
80211 association
host must associate with an AP scans channels listening for beacon frames
containing APrsquos name (SSID) and MAC address
selects AP to associate with may perform authentication
bull Eg WPA personal each wireless host configured with same passphrase (password)
will typically run DHCP to get IP address in APrsquos subnet
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Wireless Mobile Networks 6-45
IEEE 80211 CSMACA
no collision detection difficult to receive (sense collisions) when transmitting
due to weak received signals (fading) avoid collisions CSMAC(ollision)A(voidance)
sender can ldquoreserverdquo channel rather than random access of data frames avoid collisions of long data frames
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Wireless Mobile Networks 6-46
Collision Avoidance RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Home Wireless Network A broadband (DSL or cable)
Internet connection a DSL modem or a cable
modem (provided by your ISP)
A wireless router or DSLcabel modem+wireless router all in one A wireless router is basically a
router and access point all in one
Typically support NAT port forwarding firewall
Data Link Layer 5-47
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-48
Ethernet 80211 WiFi
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-49
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
Point-to-point link
BSS 1
AP
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Data Link Layer 5-50
Point to Point Data Link Control one sender one receiver one link easier than
broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line T1 leased line
popular point-to-point DLC protocols PPP (point-to-point protocol) HDLC High level data link control
bull default protocol on all Cisco serial interfaces
SLIP the book Frame Relay
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
used for dial up connection to Internet (RFC 1661) Books talk about configuration of PPP
Dial-up Internet connection Uses public switched telephone network (PSTN) to
establish a connection to an ISP via phone lines Modem encode and decode Internet
Protocol packets into and from analogue audio frequency signals
Point to Point Protocol (PPP)
Data Link Layer 5-51
56kbps Modem
USB port
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Outline General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-52
Ethernet 80211 WiFi
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Configure Network Interface Card (NIC) ie Adapter
TCPIP independent of underlying physical network
Need to identify network interface to TCPIP Assign IP address subnet
mask broadcast address
Data Link Layer 5-53
controller
physicaltransmission
cpu memory
network adaptercard
host schematic
applicationtransportnetwork
link
linkphysical
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Determine available interface
Need to find out what interfaces are available and their names
Recall dmesg display system messages displayed on console during last bootdmesg | grep eth Here | is pipeline feed the output of dmesg
as input to grep search lines in dmesg that contain ldquoethrdquo
typical name for ethernet NIC
Data Link Layer 5-54
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
dmesg | grep eth[ 19490092] e1000e 000000190 eth0 (PCI Express25GTsWidth x1) 0016d3c2e6bd[ 19490097] e1000e 000000190 eth0 Intel(R) PRO1000 Network Connection[ 19490131] e1000e 000000190 eth0 MAC 6 PHY 6 PBA No FFFFFF-0FF[ 25714699] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25719530] NetworkManager[754] ltinfogt (eth0) carrier is OFF[ 25720162] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720184] NetworkManager[754] ltinfogt (eth0) new Ethernet device (driver e1000e ifindex 2)[ 25720687] NetworkManager[754] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0[ 25720709] NetworkManager[754] ltinfogt (eth0) exported as orgfreedesktopNetworkManagerDevices0 hellip
Data Link Layer 5-55
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Sample output of netstat -in
To see hardware interface amp software interface netstat -in
[xiaolanthinkpad ~]$ netstat -niKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgeth0 1500 0 0 0 0 0 0 0 0 0 BMUlo 16436 0 32 0 0 0 32 0 0 0 LRUwlan0 1500 0 598 0 0 0 550 0 0 0 BMRU
Data Link Layer 5-56
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Loopback device
a virtualsoftware network interface usually named lo lo0 implemented in software only Any traffic that sent to loopback interface is
immediately received on same interface commonly used IPv4 address on loopback device is
127001 Usage test IP stack services without exposing
host to security risks Accessing web server
http127001 or httplocalhost Test IP stack in operating system ping 127001
Data Link Layer 5-57
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Check interface configuration ifconfig ltinterface_namegt [xiaolanthinkpad ~]$ ifconfig wlan0
wlan0 Link encapEthernet HWaddr 001DE003C5AF inet addr19216817 Bcast1921681255 Mask2552552550 inet6 addr fe8021de0fffe03c5af64 ScopeLink UP BROADCAST RUNNING MULTICAST MTU1500 Metric1 RX packets1675 errors0 dropped0 overruns0 frame0 TX packets1152 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes1634505 (15 MiB) TX bytes171812 (1677 KiB)[xiaolanthinkpad ~]$ ifconfig eth0eth0 Link encapEthernet HWaddr 0016D3C2E6BD UP BROADCAST MULTICAST MTU1500 Metric1 RX packets0 errors0 dropped0 overruns0 frame0 TX packets0 errors0 dropped0 overruns0 carrier0 collisions0 txqueuelen1000 RX bytes0 (00 b) TX bytes0 (00 b) Interrupt20 Memoryf8200000-f8220000
Data Link Layer 5-58
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Configure NIC manually
Various configuration using ifconfig IP address netmaskbroadcast addr ARP
promiscuous mode MTU hellip Details P 141-148 of textbook
Problem Ifconfig does NOT store this information
permanently Upon reboot this information is lost
Solution Put commands to system boot sequence by
adding them to file etcrcdrclocal (for linux)
Data Link Layer 5-59
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Network GUI Configuration Tools
Data Link Layer 5-60
Various tools for make permanent changes ie change is retained and used upon system boot GUI Network configuration
usrsbinsystem-config-network TUI configuration tool
usrsbinsystem-config-network-tui TUT network configuration tool usrsbinnetconfig
usrbinnetcfg (GUI)
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Most brute force approach
Manually modify system TCPIP Network configuration files etcresolveconf List DNS servers for
internet domain name resolution etchosts Lists hosts to be resolved locally
(not by DNS) etcnsswitchconf List order of host name
search Typically look at local files then NIS server then DNS server
etcsysconfignetwork-scriptsifcfg-device configuration for NIC
Data Link Layer 5-61
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Next class lab class To prepare
Install Linux on your laptop Try commandstools mentioned today (homework to
be assigned) Bring your laptop to class
simplest form of connection between two computers is a direct connection using a single Ethernet cable to enable data transfer
bull Category 5 Crossover Ethernet Cable using WiFi ad-hoc mode
bull no base stationsbull nodes can only transmit to other nodes within link coverage
Data Link Layer 5-62
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-
Summary General link layer topics
Service Network Interface Card Link layer address (MAC) ARP shared-link and Multiple Access Control
8023 Ethernet Overview Bus topology starttopology switch
80211 Wireless LAN AP CSMACD association wireless router
Point-to-Point Link Layer protocols NICNetwork configuration in Linux
Loopback interface
Data Link Layer 5-63
Ethernet 80211 WiFi
- Slide 1
- Internet protocol stack
- Encapsulation
- Link Layer Terminology
- Where is the link layer implemented
- Adaptors Communicating
- Two types of ldquolinksrdquo
- Outline
- Link Layer Services
- MAC Addresses and ARP
- LAN Addresses and ARP
- ARP Address Resolution Protocol
- ARP protocol Same LAN (network)
- Linux command arp
- Slide 15
- Multiple Access Links and Protocols
- Multiple Access protocols
- MAC Protocols Channel Partitioning
- MAC Protocols Random Access
- CSMA (Carrier Sense Multiple Access)
- MAC Protocols ldquoTaking turnsrdquo
- ldquoTaking Turnsrdquo MAC protocols
- Slide 23
- Slide 24
- Ethernet
- 8023 Ethernet Standards Link amp Physical Layers
- Ethernet CSMACD algorithm
- Ethernet Frame Structure
- Bus topology
- Star topology
- Switch Table
- Switch self-learning
- Switch frame filteringforwarding
- Self-learning forwarding example
- Interconnecting switches
- Institutional network
- Switches vs Routers
- Slide 38
- wireless network
- Wireless Link Characteristics (1)
- Characteristics of selected wireless link standards
- IEEE 80211 Wireless LAN
- 80211 LAN architecture
- 80211 association
- IEEE 80211 CSMACA
- Collision Avoidance RTS-CTS exchange
- Home Wireless Network
- Slide 48
- Slide 49
- Point to Point Data Link Control
- Point to Point Protocol (PPP)
- Slide 52
- Configure Network Interface Card (NIC) ie Adapter
- Determine available interface
- Slide 55
- Sample output of netstat -in
- Loopback device
- Check interface configuration
- Configure NIC manually
- Network GUI Configuration Tools
- Most brute force approach
- Next class lab class
- Summary
-