CSE 122 / 222C ; WES 269�Networking Primer
Pat Pannuto, UC San Diego
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Networking Primer Goals
2
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Outline
3
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Communication layers
4
What goes on at each of these?
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
OSI model of communication layers
5
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
OSI model of communication layers
6
CSE
123
CSE
124
This
Class
EE courses
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Protocols are “layered”
7
Data
Packet�Header
Frame�Header
Internet Packet
Ethernet Frame
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Analogy: Sending a letter
8
Application:�Purpose/type of letter
Transport:�Carrier service
Named recipient
Network:�Street Address
Courier
Mailing/shipping�infrastructure
Link:�Transfer to�post office
Physical:�Moving tangible�object
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Host: sends packets of data
host sending function:
R: link transmission rate
host
1
2
two packets,
L bits each
packet
transmission
delay
time needed to
transmit L-bit
packet into link
L (bits)
R (bits/sec)
=
=
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Host: sends packets of data
host sending function:
R: link transmission rate
host
1
2
two packets,
L bits each
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Protocols are “layered”
11
Internet Packet
Ethernet Frame
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Packet encapsulation
12
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Encapsulation
Introduction: 1-13
source
application
transport
network
link
physical
Ht
Hn
M
segment
Ht
datagram
destination
application
transport
network
link
physical
Ht
Hn
Hl
M
Ht
Hn
M
Ht
M
M
network
link
physical
link
physical
Ht
Hn
Hl
M
Ht
Hn
M
Ht
Hn
M
Ht
Hn
Hl
M
router
switch
message
M
Ht
M
Hn
frame
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Transmitting data between networks
14
LAN2
protocol
software
client
LAN1
adapter
Host A
LAN1
data
(1)
data
PH
FH1
(4)
data
PH
FH2
(6)
data
(8)
data
PH
FH2
(5)
LAN2 frame
protocol
software
LAN1
adapter
LAN2
adapter
Router
data
PH
(3)
FH1
data
PH
(2)
internet packet
(7)
data
PH
protocol
software
server
LAN2
adapter
Host B
PH: Internet packet header
FH: LAN frame header
LAN1 frame
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Model != reality
15
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Layering for IoT (joke) (kind of)
16
MQTT
MQTT is a publish/subscribe message broker
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Outline
17
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
The Internet: a “nuts and bolts” view
mobile network
home network
enterprise
network
national or global ISP
local or regional ISP
datacenter
network
content
provider
network
Ethernet
HTTP
Skype
IP
WiFi
4G
TCP
Streaming
video
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
The global Internet
19
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
What’s a protocol?
Human protocols:
… specific messages sent
… specific actions taken when message received, or other events
Network protocols:
Protocols define the format, order of messages sent and received among network entities, and actions taken on message transmission, receipt
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Hardware and software organization of an Internet application
21
TCP/IP
Client
Network
adapter
Global IP Internet
TCP/IP
Server
Network
adapter
Internet client host
Internet server host
Sockets interface
(system calls)
Hardware interface
(interrupts)
User code
Kernel code
Hardware
and firmware
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
A programmer’s view of the internet
1. Hosts are mapped to a set of 32-bit IP addresses
2. The set of IP addresses is mapped to a set of identifiers called Internet domain names
3. A process on one Internet host can communicate with a process on another Internet host over a connection
22
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
IP addresses
23
/* Internet address structure */
struct in_addr {
uint32_t s_addr; /* network byte order (big-endian) */
};
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Domain Naming System (DNS)
24
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Internet connections
25
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Connection performance
26
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Ports are used to identify services to the kernel
27
Web server
(port 80)
Client host
Server host 128.2.194.242
Echo server
(port 7)
Service request for
128.2.194.242:80
(i.e., the Web server)
Web server
(port 80)
Echo server
(port 7)
Service request for
128.2.194.242:7
(i.e., the echo server)
Kernel
Kernel
Client
Client
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
How does the Internet route packets?�(simplified…)
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Addressing
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Addressing
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Addressing - Intranet and Internet
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Getting an IP from `your building’s network`
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Aside: Who owns what?�https://ipinfo.io/AS7377
33
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Identifying your computer?
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
How to get across campus?
141.211.60.0/21
141.211.80.0/21
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Only go up as far as you need
141.211.68.100/32 (you)
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
How to get across the country?
141.211.68.100
72.14.204.104
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
No central authority of whole of address space…
141.211.68.100
72.14.204.104
0.0.0.0/0 ??
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing
1.0.0.0/8
5.0.0.0/8
2.0.0.0/8
10.0.0.0/8
4.0.0.0/8
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing
1.0.0.0/8
5.0.0.0/8
2.0.0.0/8
10.0.0.0/8
4.0.0.0/8
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing – ”Adaptive”
1.0.0.0/8
5.0.0.0/8
2.0.0.0/8
10.0.0.0/8
4.0.0.0/8
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing – Promises
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing – Speed?
1.0.0.0/8
5.0.0.0/8
2.0.0.0/8
10.0.0.0/8
4.0.0.0/8
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Who routes to who?
1.0.0.0/8
5.0.0.0/8
2.0.0.0/8
10.0.0.0/8
4.0.0.0/8
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing – Choices
1.0.0.0/8
5.0.0.0/8
2.0.0.0/8
10.0.0.0/8
4.0.0.0/8
3.0.0.0/8
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing – Congestion
1.0.0.0/8
5.0.0.0/8
2.0.0.0/8
10.0.0.0/8
4.0.0.0/8
3.0.0.0/8
20.0.0.0/8
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing – Congestion + Time
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing – Congestion + Time
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Routing – Other considerations [pre-2010, hah!]
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Some Perspective: North America (in June, 1999)
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Internet structure: a “network of networks”
51
ISP A
ISP C
ISP B
access
net
access
net
access
net
access
net
access
net
access
net
access
net
access
net
access
net
access
net
access
net
…
…
…
…
…
…
Networks of ISPs connect to provide global connectivity
IXP
IXP
access
net
access
net
regional ISP
access
net
access
net
access
net
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Some Perspective: The Internet
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
So how does the Internet of Things fit into the Internet?
53
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Break + Thinking
54
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
ALL the layers
55
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell
Lab 1: How does your Internet work?
56
CSE 122/222C ; WES 269 [WI25]
CC BY-NC-ND Pat Pannuto – Content developed in coordination with Branden Ghena and Brad Campbell