IOT Module 4
IOT Module 4
Module 4: Wired
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Is wireless enough?
• Wireless communication isn’t appropriate for long distances,
low-latency, high reliability, high-bandwidth, etc.
• Controlled devices
connected to 802.11
(Wifi)
“gateway”/“hub” Hue SmartBulb
Per-Floor
Distribution
Switches
(Ethernet)
Building
Management Lighting Alarm Security
System (BMS) Controller Panel Headend
Horn/ Microwave/
Chilled Beam Lights IR/Laser Sensor
Strobe
Applications
border E-Governance
routers firewall IPS
Fiduciary/Accounting
3rd Party/Citizen Apps
Internet
IP Core
(Ring)
IPS
firewall
Electrical power Traffic control Critical services Medical services Operation center
services (smart grid, (monitoring, (fire, police, (hospital,
smart metering) parking) security) paramedics,
medivac)
[title: Enterprise
Networking]
[week X: video X]
[status: done]
How Layer 2 and Layer 3 Networking Fit
Together To upstream ISPs or
regional IP backbone
Core (Layer 3
forwarding)
IP backbone
(ISP, intra-network
backbone, VPN)
Edge (Layer 2
forwarding)
Ethernet Ethernet Ethernet
To end devices or
local networks
Ethernet (Layer 2) vs. IP (Layer 3) Routing
• Ethernet is “plug and play”
• Easy to build networks
• May optionally configure ACLs, SSIDs (wireless), spanning tree
properties, etc.
0D:73:CA:F3
Dest Nexthop
17.3.6.2
17.0.0.0/24 fe0/1
F5:5A:21:03
Dest Nexthop
29.51.130.9
17.0.0.0/24 fe7/1
Hey everybody –
I own Dest Nexthop
17.3.6.0/24! 17.0.0.0/24 fe0/0
L2 Switching vs. L3 Routing:
Switching Relies on Broadcast
Dest Nexthop
Data 0D:73:CA:F3 fe0/1
Messages
0D:73:CA:F3
17.3.6.2
F5:5A:21:03
29.51.130.9
End Host
0D:73:CA:F3
Switch
0D:73:CA:F3
15
Avoiding Flooding
• Suppose source sends a frame to a destination
• Which links should a frame be forwarded on?
• Trivial algorithm
• Forward all frames on all (other) LANs
• Problem: Wastes bandwidth to flood everything everywhere
• Better approach: “Learn” where hosts are
• Listen to broadcasts, remember which direction source is
dest
A B
source
Learning Switches
• Switch learns table entries based on source address
• When receive frame from host on port 1, add host to list of hosts on port 1
• Time out entries to avoid stale entries
• Table is an “optimization”
• Improves performance but is not mandatory
X Y Z Y 2
Z 2
Scaling Ethernet with VLANs PCI
POS
VLAN PCI (credit
HVAC
• Divide up hosts into logical Controls System card) server
groups called VLANs
• Like virtual machines, but for
LANs (creates “virtual networks”)
• VLANs isolate traffic at layer 2
POS System
• Each VLAN corresponds to IP
subnet, single broadcast
domain
• Ethernet packet headers have
VLAN tag
HVAC Room
• Switches forward packet only HVAC Sensors
on subnets on corresponding VLAN
VLAN
18
Virtual LANs
• Downsides of VLANs
• Are (usually) manually configured, complicates network
management
• Hard to seamlessly migrate across VLAN boundaries due to
addressing restrictions
• Upsides of VLANs
• Limits scope of broadcasts
• Logical separation improves isolation, security
• Can change virtual topology without changing physical
topology
• E.g., used in data centers for VM migration
How VLANs Are Configured
Access ports
VLAN 2
Trunk ports
VLAN 1
Trunk ports
VLAN 1
• Native mode
• IEEE likes to make specs that are backwards compatible
• 802.1Q allows trunk ports to carry both tagged and untagged frames
• Frames with no tags are said to be part of the switch’s native VLAN
24
Encapsulation
Encapsulation
Priority (PCP)
Protocol ID DEI VLAN Identifier (VID)
1 (background), 0 (best-effort, default), 2
Set to 0x8100 to Indicates if frame 12 bits allows for 4096 VLANs
(excellent effort), 3 (critical application), 4
identity frame as a can be dropped 802.1ad allows for double
(video), 5 (voice), 6 (internetwork control),
802.1Q-tagged frame during congestion tagging
7 (network control)
Used
Nobody really uses
Offsets Octet 0 1 2 3
Octet Bit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
20 160
Checksum
24 192
Options (if IHL > 5) computed over
28 224 header
32 256
• Hierarchical Allocation
• Organizational Unique Identifier (OUI) – first 24 bits
• Assigned to vendors (e.g., Dell) by the IEEE
• Vendor-assigned address – last 24 bits
• Assigned by the vendor
• Hierarchical Allocation
• ICANN (previously IANA) manages global IPv4 and IPv6 space
• ICANN delegates blocks (prefixes) of addresses to regional internet
registries (RIRs)
• APNIC, ARIN, LACNIC, RIPE NCC
• ISPs request blocks from RIRs
• Enterprises and smaller ISPs request blocks from provider ISPs
Address Discovery
• A host starts up knowing only its MAC address
10.0.0.3 acquired
DHCP RELEASE Returns
“I am done with
10.0.0.3” 10.0.0.3 to
available pool
Dest=4.4.4.4
IP=2.2.2.2 IP=4.4.4.4
MAC=AA:AA:AA:AA:AA MAC=CC:CC:CC:CC:CC
IP=5.5.5.5
IP=3.3.3.3 MAC=DD:DD:DD:DD:DD
MAC=BB:BB:BB:BB:BB
Broadcast ARP reply:
IP MAC “I own 4.4.4.4, and
4.4.4.4 CC:CC:CC:CC:CC my MAC address is
Broadcast 5.5.5.5 DD:DD:DD:DD:DD CC:CC:CC:CC:CC”
ARP request:
“Who owns IP
address
4.4.4.4?”
IP=2.2.2.2 IP=4.4.4.4
MAC=AA:AA:AA:AA:AA MAC=CC:CC:CC:CC:CC
IP=3.3.3.3
MAC=BB:BB:BB:BB:BB
Broadcast Gratuitous
ARP reply: IP=5.5.5.5
IP=3.3.3.3 MAC=BB:BB:BB:BB:BB
MAC=BB:BB:BB:BB:BB
“I own 5.5.5.5, and
my MAC address is
BB:BB:BB:BB:BB”
• Browser communicates
with OS through API
(“system calls,” or
“sockets”)
What the Computer Needs to Do Server
22.61.14.163
9C-EF-D5-FD-27-77
Laptop
10.7.18.96
00-14-22-01-23-45
Hey server:
Give me the web page for
Hyper Text Transfer Protocol:
“www.illinois.edu/index.html” Telling a Web Server What to Do
What you want What resource
server to do you are referring
HTTP Version
(HTTP Method) to (URL)
Network Memory
• Provides similar interfaces for HDD Device Driver Device Device
TCP and UDP Driver Driver
SDD
NIC Memory
Sockets API: What functions to expose?
• Data structures to store information about connections
and hosts
• IP address and port (struct sockaddr_in), socket
number (int)
• Functions to establish and tear down connections
• Get available socket number (socket()) associates socket
with network address (bind())
• Functions to send and receive data
• Send data string (send()), receive data string (recv())
Example Sockets Program: Web Client
Socket descriptor: index into per-
process table of connections
int main (){
maintained by kernel
int sockfd = 0, numbytes = 0;
Information about host:
char buf[MAXDATASIZE + 1];
Domain name
struct hostent* he = NULL; List of addresses
if (argc != 2) {
fprintf (stderr, “usage: client hostname\n”);
exit (1); Performs DNS lookup to get IP
} address for specified hostname
if ((he = gethostbyname (“www.msnbc.com”)) == NULL) {
perror (“gethostbyname”);
exit (1);
}
Example Sockets Program: Web Client
if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) == -1) {
Returns available
perror (“socket”); socket descriptor
exit (1);
}
struct sockaddr_in their_addr;
Specifies identity of
their_addr.sin_family = AF_INET; server we will connect to,
their_addr.sin_port = htons (PORT); using data we got from
DNS lookup
their_addr.sin_addr = *((struct in_addr*)he->h_addr);
bzero (&(their_addr.sin_zero), 8);
if (connect (sockfd, (struct sockaddr*)&their_addr,
sizeof (struct sockaddr)) == -1) {
Forms logical connection
perror (“connect”); to server; initiates TCP 3-
exit (1); way handshake
}
Example Sockets Program: Web Client
if (send(new_fd,“GET /index.html HTTP/1.1\n\n", 27, 0) == -1) {
perror("send");
}
Sends string of text
to server
buf[numbytes] = ‘\0’;
printf (“Received: %s”, buf);
close (sockfd);
return 0;
}
Tell OS we are done with this socket,
which will clean up state and tears
down any connections (TCP FIN)
Putting Things Together:
How a Packet Is Sent across Networks
User types: 22.22.22.163
“www.illinois.edu” 9C-EF-D5-FD-27-77
Laptop Server
11.11.11.96
00-14-22-01-23-45
22.22.22.18 11.11.11.72
24-E3-0A-7A-B7-38 5B-F0-23-C8-F9-2E
Local DNS Server
Putting Things Together:
How a Packet Is Sent across Networks
11.11.11.96
dest MAC: dest IP: “GET /index.html
BC-15-59-B5-4F-1A
9C-EF-D5-FD-27-77 11.11.11.96 HTTP/1.1”
Laptop
22.22.22.163
9C-EF-D5-FD-27-77
Server
22.22.22.3
44-7B-C1-2D-28-81
22.22.22.0/24 11.11.11.0/24
18.22.14.163
9C-EF-D5-82-06-B8
22.22.22.18 11.11.11.72
24-E3-0A-7A-B7-38 5B-F0-23-C8-F9-2E
Local DNS Server
Putting Things Together:
How a Packet Is Sent across Networks
Forwarding Table
Next Hop Interface
22.22.22.0/24 Ge0/1
11.11.11.0/24 Ge0/2
dest MAC: dest IP: “GET /index.html
11.11.11.96
BC-15-59-B5-4F-1A 11.11.11.96
9C-EF-D5-FD-27-77 HTTP/1.1”
BC-15-59-B5-4F-1A
Laptop 22.22.22.163 is at
22.22.22.163
9C-EF-D5-FD-27-77 9C-EF-D5-82-06-B8
Server
22.22.22.3
44-7B-C1-2D-28-81
Ge0/2
22.22.22.0/24 11.11.11.0/24
Ge0/1
ARP who-has 11.11.11.96? tell
11.11.11.163
ARP Table:
11.11.11.96 11.11.11.163
BC-15-59-B5-4F-1A 9C-EF-D5-82-06-B8
22.22.22.18 11.11.11.72
24-E3-0A-7A-B7-38 5B-F0-23-C8-F9-2E
Local DNS Server
Putting Things Together:
How a Packet Is Sent across Networks
11.11.11.96
BC-15-59-B5-4F-1A
Laptop
22.22.22.163
9C-EF-D5-FD-27-77
Server
22.22.22.3
44-7B-C1-2D-28-81 dest MAC:
BC-15-59-B5-4F-1A
dest IP:
11.11.11.96
“GET /index.html
HTTP/1.1”
Ge0/2
22.22.22.0/24 11.11.11.0/24
Ge0/1
11.11.11.163
9C-EF-D5-82-06-B8
22.22.22.18 11.11.11.72
24-E3-0A-7A-B7-38 5B-F0-23-C8-F9-2E
Local DNS Server
Steps in Creating a Packet (Summary)
• On bootup, use DHCP to discover NIC configuration
• On gethostbyname() resolution request
• Use DNS lookup to determine IP address
• Check subnet mask to determine if IP address is on local subnet
• If so, use ARP if local DNS server’s MAC address not in ARP table
• If not, use ARP if subnet gateway’s MAC address not in ARP table
• Send DNS lookup in UDP packet with corresponding IP and MAC address
destinations
• Return discovered IP address to caller
• On send() call:
• Use similar steps to above to discover MAC address and send packet
[title: Network
Infrastructure]
[week X: video X]
[status: done]
How do you design a network?
• A network has goals
• Connect sensors to internet
• Filter bad traffic
• Provide voice over IP functionality
• Run-time:
1. Determine if self is responsible next-hop for flow
2. Lookup/determine next hop
3. Forward out appropriate outbound interface
Device Types: Processing
• Run-time:
1. Receive flow
2. Perform operations on flow (intercept, cache, mark, manipulate
headers/data/packets)
Device Types: Translation
NAT PBX Switch Wireless DSLAM Optical
Bridge Transport
• Run-time:
1. Determine if self is responsible next-hop for flow
2. Lookup/determine translation
3. Modify packets
Device Types: Isolation
• Run-time:
1. Select appropriate header fields or content in flow
2. Traverse policy list, process (usually first) matching rule
3. Forward or filter traffic appropriately
Scenario: Hospital IoT
Deployment
Scenario: Hospital IoT Deployment
Firewall
NAT/Firewall
Permit ip *.*.3.* *.*.3.*
Deny ip *.*.3.* 10.*.*.*
Permit ip *.*.3.* *.*.*.*
Firewall/IDS/IPS
L3 Switch
VRF IT
Core L3 Switches VRF HVAC
VRF Manufacturing
Switch 1:
Voice: Vlan 3 Distribution
10.1.3.0/24
POS: Vlan 8 Switches
10.1.8.0/24
Access Switches
V H H
Switch 3:
IT: Vlan 3 10.3.3.0/24
Voice Security HIPAA Finance: Vlan 8 10.3.8.0/24
Manufacturing: Vlan 44 10.3.44.0/24
Example Network: Broadband Access
Receiver
DOCSIS 3.0 Internet
Fan module
LED status
indicators Power
module
Optical
port
• Backplane can be
implemented in different ways:
Backplane
• Shared memory (low-capacity
routers, e.g., software routers)
• Shared bus
• Switched bus (highest-capacity
routers)
Input Input Output Output
interfaces queues queues interfaces
76
Backplane Speedup Backplane
Aggregate
Transfer Capacity
• Backplane needs to be fast (BT)
enough to handle offered Network Router
load from all ports
• Router architects perform
calculations to provision Backplane
• On commercial routers:
• Interconnection network and interface
cards are sophisticated, special-purpose
hardware
• Packet forwarding often implemented in a
custom ASIC
• Only routing (control plane) is done on
the commodity CPU (route processor)
Head-of-Line Blocking
Input 1 Output 1
Input 2 Output 2
Input 3 Output 3
Backplane
Input 1 Output 1
Input 2 Output 2
Input 3 Output 3
Backplane
Head-of-Line Blocking
• Cell at the head of the queue can’t be sent, blocking
cells behind it that could otherwise be sent
86
Head-of-Line Blocking
Maintain at each input up
Input 1
to N virtual queues, e.g.,
one per output
X Output 1
Input 2 Output 2
Output 3
Backplane
Input 3
Downsides: increases port cost
Mitigating Head-of-Line Blocking with
Virtual Queues
• Maintain at each input N virtual queues, i.e., one per output
88
How the Control and Data Planes Work
Together (Logical View)
Update
12.0.0.0/8
Protocol daemon
Control
Plane
RIB
12.0.0.0/8 IF 2
IF 1 Data
FIB 12.0.0.0/8 IF 2
Plane
IF 2
12.0.0.0/8
Data packet
Physical Layout of a High-End Router
Routing vs. Forwarding
• Routing is done in software (“control plane”)
• Computing paths the packet will follow
• Computation performed on router’s CPU
• Creates forwarding table as output
• On commercial routers,
control plane runs on
special-purpose “route
processor”
• IP forwarding is distributed
across the interface cards
Slotted Chassis
• Large routers are built in a
slotted chassis
• Interface (line) cards are inserted
in the slots
• Route processor is also on a line
card
Router with slotted chassis
_ +
• Silver plated copper: better conduction, operation over wider temperature range
(-65°C to 200°C). Commonly used in aerospace applications
destination
Reducing Noise with Twisted Pairing
• Disadvantages:
• EMI protection depends on pair twisting staying intact stringent requirements for
maximum pulling tension and minimum bend radius (bonded TP can help)
• Twisted pairs in cable often have different # of twists per meter color defects and
ghosting on analog video (CCTV)
Insulators
• Insulators separate conductors, electrically and physically
• Avoid air gaps: ionization of air can degrade cable quality
•…
Cable Ratings
© 2006 David Monniaux / CC BY-SA 3.0 / http://tinyurl.com/y4juntpn , © 1947 DCC Archives CC BY-SA 2.0 , © Richard Webb / CC BY-SA 2.0
Submarine Cabling
Undersea Cable Laying
Submarine Cabling: Threats
Submarine Cabling: Construction
Polyethylene
Mylar tape Stranded steel wires
Polycarbonate
Petroleum jelly
Optical fibers
Submarine Cabling: Threats
Physical Tapping
Physical Tapping
• Conductive Taps
• Form conductive connection with
cable
• Inductive Taps
• Passively read signal from EM
induction
• No need for any direct physical
connection
• Harder to detect
• Harder to do with non-electric
conductors (e.g., fiber optics)
Tapping Cable: Countermeasures
• Physical inspection
• Physical protection
• E.g., encase cable in pressurized gas
UNSAFE
FIGURE (video)
Motivation:
Wave Pulse on a String
Water-soaked/flooded cable
138
TDR Examples
Faulty Amplifier
Wire Tap
139
Protection against Wildlife
Rodents Moths
Ants