Lec 01
Lec 01
Introduction to Computer
Networks
Class Intro
Overview of packet switching and the Internet
Packet switching performance
Structure of the Internet
Internet protocol layers
Internet security
Roch Guerin, with adaptations from Jon Turner and John DeHart
Structure of Course
Course web site (wiki):
o http://classes.engineering.wustl.edu/cse473/index.php/Main_Page
o Check out the Syllabus page
• Schedule and copies of lectures, labs, quizzes, exams, etc.
• Reading assignments: get you ready for each lecture
– Including RFCs: IETF Request For Comments
» “Standards” documents from the Internet Engineering Task Force
• Review Questions due almost every class, based on that day’s
lecture’s reading assignment
• 15 minute Quizzes about every two weeks
o Grades:
• 10% : Review Questions (binary grades based on “effort”)
• 20% : Quizzes (lowest quiz score is dropped)
• 25% : Labs
• 20% : Midterm
• 25% : Final
2
Structure of Course (continued)
Lectures
o At the end of each lecture, time permitting, there
will be some exercises to see what we have
learned
Office hours: Listed on web site
TAs:
o Right now we have three:
• Jiayi Song
• Xin Yan
• Lingxin Zhao
o Office hours TBD
3
Structure of Course (continued)
Studios
o Basically warmups for the Labs
Git repository on bitbucket
o Code for studios and labs will come to you via your
Git repository, and you will submit your solutions
using Git as well
• See the wiki for details
Piazza
o Link to class Piazza page on course web site
o Ask questions there so everyone can benefit
• We will not respond to direct email questions.
• There are no dumb questions!
o Sign up for our class on Piazza 4
•
Some Key Course Goals
Architectural principles of the Internet (RFC 1958)
o Primary goal is connectivity
o Constant change (the network is not static)
o End-to-end argument
o Key is IP protocol
Understanding sources and causes of packet delay
Socket programming
Reliable Data Transport a.k.a. TCP:
o Connection setup
o Reliability
o Flow control
o Congestion control
IP Routing
Internet system of protocols
5
Some Internet security
Our Scope – Broadly Speaking
6
The Internet process
protocol
protocol
router
p1 p2 ...
host
socket
network
stack
IP
address packet
1.2.3.4
router p2
p1 ...
host
socket
network
stack
IP
address packet
1.2.3.4
Data myAddress
Data L4
9
Internet Packet Format (Version 4)
Version IHL DSCP+ECN Total Length
…. Payload ….
Version (4 bits): Value = 4 (0100) for IPv4
IHL (4 bits): Header length in 32-bit words
DSCP: Differentiated Service Code Points (6 bits), Explicit Congestion Notification (2 bits)
Total Length (16 bits): Header+payload length in bytes (min=20bytes, max=65,535bytes)
Identification (16 bits): Identifies group of fragments
Flags (3 bits): Specifies fragmentation status
Fragment offset (13 bits): Location of fragment in original packet
TTL (8 bits): Decremented by one by each router. Packet is discarded when TTL reaches 0
Protocol (8 bits): Identifies protocol used in data payload (1: ICMP, 6: TCP, 17: UDP)
Header Checksum (16 bits): Error detection field
Options: 1st byte indicates presence/absence of option, 2 nd byte is option length, remaining bytes are option
10 data
Internet Packet Format (Version 6)
Version Traffic Class Flow Label
11
Note: No header checksum (assumes that link layer does error detection)
Internet Addresses
IPv4: 32 bits (4x8) – 232 distinct addresses
o Represented as a.b.c.d, where a, b, c, d, are 8-bit numbers
in the range 0,…,255
o 0 = 00000000, 1 = 00000001, 2 = 00000010, … ,
255 = 11111111
12
Circuit Switching
The main alternative to packet switching
o provides a dedicated communication channel (a circuit) to
transmits information, not packets, from source to destination
• telephone networks have traditionally used circuit switching
o calls for an initial setup phase, but then data flows continuously
and unimpeded
o relatively simple technology developed and evolved over more
than 100 years
13
Packet vs. Circuit Switching
Letscompare packet and circuit switching
Two examples:
o File Transfer
o Streaming application
What are the delays involved with each?
14
Packet vs. Circuit Switching
File transfer – Packet
Sequence of n packet switches, links of speed c bits/sec, propagation delay of δ sec for each
“hop”
c c
L+H
c
L+H
c
L+H L+H
M bits bits bits bits
c M n=4
bits bits
δ δ δ δ δ
File size M bits, packet header H bits, maximum packet payload size L bits
o Number of bits transmitted: M+M/LH – need to include header bits for all packets
o Last bit leaves source at t0=(M+M/LH)/c – transmission of all the bits (payload+headers)
o Last bit arrives at first switch at t1=t0+δ =(M+M/LH)/c+δ – propagation time to next switch
o Last bit leaves first switch at time t2=t0+δ+(L+H)/c – transmission time of last packet
• Assumes that packet must be fully received before being retransmitted – no cut-through
o Last bit leaves last (nth) switch at t2n=t0 + nδ + n(L+H)/c - repeats at each switch
o Last bit arrives at destination at t2n+1=t2n+ δ
M=106 bits, H=100 bits, L=10000 bits, c=106 bits/sec, δ=5 msec, n=4 Td=1.075 sec
M=106 bits, H=100 bits, L=10000 bits, c=109 bits/sec, δ=5 msec, n=4 15
Td=26.05 msec
Packet vs. Circuit Switching
File transfer – Circuit
Sequence of n circuit switches, circuit of speed c bits/sec, propagation delay of δ
sec for each “hop”
M c c c c c n=4
M
bits bits
δ δ δ δ δ
File size M bits, setup processing time of σ at each hop
o Initiate connection at t=0
o Circuit setup time: 2(n+1)(δ+σ) - setup message from source to destination and back
o Last bit leaves source at t0= M/c +2(n+1)(δ+σ) – transmission of all payload bits
o Last bit arrives at destination at t2n+1=t0 + (n+1)δ – end-to-end propagation
M=106 bits, c=106 bits/sec, δ=5 msec, σ=1 msec, n=4 Td=1.085
sec
M=106 bits, c=109 bits/sec, δ=5 msec, σ=1 msec, n=4
16
Td=86 msec
Packet vs. Circuit Switching
File transfer
Packet download time
Difference:
c c
L+H
c
L+H
c
L+H L+H
R bps L+H
bits
bits bits bits bits
c L+H
bits
R bps
n=4
δ δ δ δ δ
Total minimum delay for first bit of packet: PS= L/R + (n+1) [(L+H)/c + δ]
R=64,000 bits/sec, H=100 bits, L=1000 bits, c=106 bits/sec, δ=5 msec, n=4
PS =46.125 msec
R=64,000 bits/sec, H=100 bits, L=1000 bits, c=109 bits/sec, δ=5 msec, n=4 18
Packet vs. Circuit Switching
Streaming application – Circuit
Sequence of n circuit switches, propagation delay of δ sec per “hop”
R bps R bps
R R R R R n=4
δ δ δ δ δ
Application generates bits at a rate of R bits/sec ( circuit of speed R bits/sec),
setup processing time of σ at each hop
o Circuit setup time: Tsetup=2(n+1)(δ+σ) - same as before
o No packetization delay!
• Bit b generated at time t0 = 0
• Bit b leaves source at time t0
Total bit transfer delay CS= (n+1)δ (basically just propagation delay)
δ=5 msec, σ=1 msec, n=4
CS =25 msec; Tsetup=60 msec (but only relevant to first bit) 19
Packet vs. Circuit Switching
Streaming application
Packet streaming delay
Circuit delay
CS = (n+1)δ
o Transmission delay:
• Time to get bits sent onto a link
o Propagation delay:
• Time for bits to travel along a path
o Queuing delay:
• Time bits spend waiting in a queue (before a link)
21
Delays in Packet Networks
Transmission delay: time to send a given number of
bits (e.g., a packet) onto a link of a given transmission
rate (bits/sec)
• Function of packet size and link speed, T=L/c, L is packet size (in
bits) and c is link speed (in bits/sec)
22
Delays in Packet Networks
Queuing delay (waiting time): Caused by contention for
transmission resources (multiple packets seeking
transmission on the same link)
o Queueing delay
• N is the number of packets in the queue (when a new packet
arrives)
• Li, i = 1,…,N, is the size of packet i in bits
• i=1,…,N Li is number of bits ahead of you (assumes FCFS)
• c is link speed in bits/sec
• Queueing delay is then i=1,…,N Li/c
o Average queueing delay W
• E[N] x E[L] is the number of bits already in the queue on average
when a new packet arrives
• Hence, W = (E[N] x E[L])/c is, the average time it takes to transmit
bits ahead in the queue, a.k.a., average queueing delay 23
Revisiting Total Network Delay
File transfer completion
o Time until last packet is ready for transmission by the source
o Plus sum of transmission, propagation, and queueing delays
at all hops for last packet
Pd= (M+M/LH)/c + n(L+H)/c + (n+1)δ +i=1,…,n Wi
24
Estimating (Average) Queueing Delay
(at a single link)
33
Exercises
1. Which of the following are not valid IPv4 addresses?
a) 12.34.5.57 b) 134.25.321.44 c) 0x23fed97c = 35.254.217.23
d) 0.0.0.0 e) 0x1435c984b f) 275.31.48.21
both b) and f) have numbers greater than 255, which is not possible
given the 8-bit limitation of each number in a 32-bit IP address.
e) involves 9 hex characters, which is too many for a 32-bit address.
34
Exercises
2. Suppose that 100 packets arrive at a router all at the
same time, and must be sent out on the same output link.
If it takes 5 ms to transmit one packet, what is the
maximum delay experienced by the arriving packets?
What is the minimum delay? What is the average delay?
35
Exercises
2. Suppose that 100 packets arrive at a router all at the
same time, and must be sent out on the same output link.
If it takes 5 ms to transmit one packet, what is the
maximum delay experienced by the arriving packets?
What is the minimum delay? What is the average delay?
36
Exercises
3. Consider the network path shown below. What is the total
end-to-end delay for a packet sent from A to B?
Labels above the links denote their transmission rates (so the middle
link has a rate of 1 Gb/s, i.e., 109 bits/sec). The labels below the links
are their lengths in km (signals propagate at 200,000 km/sec). Traffic
intensities are shown at the left end of each link. The average packet
length is 250 bytes. Assume infinite queues at each node.
10G 1G 1G 2M 10M
.1 km 200 km 1000 km 2 km .02 km
A =.9 =.98 =.5 =.1 B
37
Exercises
3. Consider the network path shown below. What is the total end-to-end delay
for a packet sent from A to B?
Labels above the links denote their transmission rates (so the middle link has a rate of 1
Gb/s, i.e., 109 bits/sec). The labels below the links are their lengths in km (signals
propagate at 200,000 km/sec). Traffic intensities are shown at the left end of each link.
The average packet length is 250 bytes.
10G 1G 1G 2M 10M
.1 km 200 km 1000 km 2 km .02 km
A =.9 =.98 =.5 =.1 B
39
Exercises
4. Using the previous exercise, the traffic intensity at the 2
Mb/s link increases to 1.5, so that the average queueing
delay at the link increases to 200 ms, what is the capacity
of the queue feeding the link? What fraction of packets are
discarded?
40
Exercises
4. Continued…
41