INTRODUCTION TO
COMPUTER NETWORKING
Amit Saha
IIT Gandhinagar
13th, 14th March 2015
Ground Rules
• There are no “silly” questions. Focus on “why”
• Slides with have fundamental concepts
• Search on the web for anything you don’t understand
• Almost everything is explained reasonably well on the web
• You can send questions to amsaha+iitgn15s@gmail.com
Books – not mandatory
• Data and Computer Communications
- William Stallings
• Internetworking with TCP/IP Volume 1 Principles, Protocols,
and Architecture
- Douglas E. Comer
What is Networking?
• networking – the exchange of information or services among
individuals, groups, or institutions
• computer networking – the exchange of information or services
among computers
A Brief History
• http://visual.ly/brief-history-computer-network-technology
Schematic of a Computer Network
The first hop – wired
The first hop – wireless
Wireless First Hop - Possibilities
• WLAN/WiFi
• Cellular
Layering – Lets Break up the Problem
TheoreticalPractical
Wireless First Hop – WiFi
• IEEE 802.11 (a/b/g/n/…) standards
• Infrastructure mode (common) or Ad hoc mode
Ethernet Token Ring
New 802.11n
Connecting to a WiFi Access Point
• Scanning
• Joining
• Authentication
• Association
• The station feels as if it is “plugged” into a wired network
Communicating with a WiFi AP
• Wireless is a half duplex channel – either speak or listen
• Signal strength is inversely proportion to square of distance
• Carrier Sense Multiple Access / Collision Avoidance (CSMA/CA)
• Fancy name for how humans talk 
• This is generally true of all wireless systems (including humans)
WiFi Equipments
Wireless First Hop – Cellular
• Not covered in this course
Wired First Hop - Ethernet
• IEEE 802.3 standard
• If two ends of the Ethernet cable (e.g., RJ45) is electrically up,
connection is up.
• Some authentication steps are usually there but we will skip those
CSMA/CD
• Carrier Sense Multiple Access / Collision Detect
Ethernet Equipments
Now what?
Getting an IP address
• DHCP – DHCP clients get IP addresses and networking
parameters from DHCP server
• Based on BOOTP
• DHCPv6 (for IPv6) is also available
DHCP Packets
• Discovery
• Offer (possibly multiple)
• Request
• Acknowledge
• Renew
• Release
Why do we need an IP address?
IP Packet Format
IPv4 Header Format
UDP Header Format
5-Tuple/Flow
Got an IP! Hurray!
• But now what? How do I “go to” some website?
• IP is just an identity
• Still need to “route” to somewhere
DNS – Domain Name Service
• We almost always try to reach a human readable name
• But machines route based on IP addresses
• There must be a mapping from names to IP addresses
• But who is going to do this translation?
Default Gateway
• If host does not know how to route, who does it ask?
• There must be a “goto” guy in the network
Routing table – Host
ubuntu@ubuntu-VirtualBox:~/Projects/OpenStack/New/cinder$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.2.2 0.0.0.0 UG 0 0 0 eth0
10.0.2.0 * 255.255.255.0 U 1 0 0 eth0
• Routing table becomes very interesting in a core router
• 50,000 to 1,00,000 routes (entries like the above table)
• We will get to it later
Who could …
• Be a host’s Domain Name Server
• Be a host’s Default Gateway
Are we ready to send?
ARP – Address Resolution Protocol
• What is the MAC address for a given IP?
• ARP resolves network layer address to link layer address
• Remember network layer is the same as routing layer. This is also known
as Layer 3(L3)
• Link Layer is Layer 2 (L2)
Ethernet – IEEE 802.3b
• Broadcast medium
• These days mostly switched Ethernet (point-to-point)
• These days mostly Ethernet II
• No LLC
Finally!
• We can now send
Ethernet Header
An Example
• Wireshark – Download it, install it and then play around with it
• Instructions are there on the web itself
• Will give you a lot of detail about packets and layering
DNS – Domain Name Service
• Hierarchical way of managing name space
• Managed by Internet Assigned Numbers Authority (IANA)
• http://www.iana.org/domains/root/db
DNS – Root Servers
• <a-m>.root-servers.net – 13 hostnames, around 500 instances
• Use anycast to reach “nearest” instance – BGP supports this
• 12 of the 13 root servers A-M exist in multiple locations
• 11 on multiple continents
• Root server ‘h’ exists in two U.S. locations.
• Root server ‘b’ exists in a single location in the Los Angeles Area
• http://www.root-servers.org/
Subnetting
• Routing to each individual hosts does not scale
• Addresses grouped into different classes
CIDR
• Any “class system” is bad 
• IPv4 was running out of unique IP addresses
• Hence IPv6 but…
• Classless Inter Domain Routing
• Network portion can be of any size
• Addresses need to specify subnet mask as well
Longest Prefix Match
NAT – Network Address Translation
NAT – Send
NAT – Receive
Routing Hierarchy
• Internet is divided into Autonomous Systems (AS)
• Managed by a single administrator
• 16 bit AS Number (ASN)
Autonomous Systems
Intra-Domain Routing
• Typically uses UDP
• Distance Vector
• RIP – Bellman – Ford Algorithm
• Link State
• OSPF – Dijkstra’s shortest path
• ISIS – Dijkstra’s shortest path
• Note: The fundamental concept here is Distance Vector and
Link State as two types of algorithms, not that they are used for
intra-domain routing
Inter-Domain Routing
• Border Gateway Protocol (BGP) – BGP version 4
• Path – vector routing
• Uses TCP
• External BGP – eBGP
• Internal BGP – iBGP
• Not to be confused with intra-domain routing (though iBGP could do that )
• Used to send information from one “side” of network to another
• Policy engineering
Inter – Domain Routing
iBGP and eBGP
Some Numbers
• http://www.cidr-report.org/as2.0/
Transport Layer
• Provides end-to-end connection
• On top of the routing layer
• Two types of transmissions
• Unreliable – User Datagram Protocol (UDP)
• Reliable – Transmission Control Protocol (TCP)
UDP
• Best effort, connection-less
• Just send as fast as possible
• When is it okay?
• Phone calls, gaming, etc.
• Simple stuff like DNS
TCP
• Connection oriented
• Setup/teardown connection
• Sends stream of bytes, not messages
• Reliable and in-order delivery
• Flow Control
• Congestion Control
• Analogous to how humans communicate
Basics of Reliable Connection
• How do you make a transmission reliable?
• What do you need to protect against?
Basics of Reliable Connection
Data
Ack
Sender Receiver
time
Speed it Up
TCP – Connection Setup
• Three-Way Handshake
TCP Sliding Window
• http://www2.rad.com/networks/2004/sliding_window/
TCP – Being a Good Citizen
• Congestion Control
• MaxWindow = min(Congestion Window, Receiver Window)
• Congestion Window start at 1
• Original TCP: Additive Increase, Multiplicative Decrease
Congestion Avoidance Behavior
Time
Congestion
Window
Packet loss
+ Timeout
Grabbing
back
Bandwidth
Cut
Congestion
Window
and Rate
Evolution of TCP
1975 1980 1985 1990
1982
TCP & IP
RFC 793 & 791
1974
TCP described by
Vint Cerf and Bob Kahn
In IEEE Trans Comm
1983
BSD Unix 4.2
supports TCP/IP
1984
Nagel’s algorithm
to reduce overhead
of small packets;
predicts congestion
collapse
1987
Karn’s algorithm
to better estimate
round-trip time
1986
Congestion collapse
observed
1988
Van Jacobson’s algorithms
congestion avoidance and
congestion control
(most implemented in
4.3BSD Tahoe)
1990
4.3BSD Reno
fast retransmit
delayed ACK’s
1975
Three-way handshake
Raymond Tomlinson
In SIGCOMM 75
Taken from Aditya Akella’s slides, Dept. of Computer Science, University of Wisconsin - Madison
TCP Through the 1990s
1993 1994 1996
1994
ECN
(Floyd)
Explicit
Congestion
Notification
1993
TCP Vegas
(Brakmo et al)
real congestion
avoidance
1994
T/TCP
(Braden)
Transaction
TCP
1996
SACK TCP
(Floyd et al)
Selective
Acknowledgement
1996
Hoe
Improving TCP
startup
1996
FACK TCP
(Mathis et al)
extension to SACK
Taken from Aditya Akella’s slides, Dept. of Computer Science, University of Wisconsin - Madison
TCP Header
Ethernet
• Original Ethernet used hub – shared ethernet
• These days – switched ethernet
Switched Ethernet
• CSMA / CD
• What is collision now? How is it handled?
Switching Types
• Store and forward
• Cut through
Switched Ethernet – Arbitrary Topology
• Can cause loops
• Unlike IP header, no TTL
to prevent looping
STP – Spanning Tree Protocol
• Creates a “tree” that “spans” entire graph
• Distributed implementation
STP – Root Bridge
STP – Root Ports
STP – Designated Ports
STP – Blocked Ports
STP – Link Failure
Virtual LAN
VLAN
IEEE 802.1q
IEEE 802.1q
STP Variants
• Rapid STP – Converges faster than STP
• VLAN STP – Each VLAN can have a different STP tree
Data Centers
• Cloud computing – Making computing elastic
• Software Defined Networking (SDN)
• Universities are using data centers for compute resources
• Pay-as-you-go pricing model
• Power and Cooling most important 
Data Centers – Network Properties
• Large number of ports
• Large number of L2 end points
• Multiple VMs per port
• Relatively fewer L3 end points
• Prime importance - manageability
Example Equipment – Pictures/Prices
• Go to websites such as www.cisco.com and www.juniper.net
and look at their product portfolio
• www.cisco.com has interactive 3D models
• Search for prices on the web
Industry Expectations
Industry Expectations
• Average loss $5600/minute  $300K/hour
• Zero planned downtime is fast becoming the norm
• Can you think of anything similar?
The Future of Computer Networks
• Manageability
• Monitoring
• Trouble shooting
• Automated Healing
• More bandwidth
• Energy efficiency
• Faster way of implementing something –
algorithms/algorithmics
• OpenSource based – cheaper and “better”
• Broadband access will become a fundamental right
Introduction to Computer Networking

Introduction to Computer Networking

  • 1.
    INTRODUCTION TO COMPUTER NETWORKING AmitSaha IIT Gandhinagar 13th, 14th March 2015
  • 2.
    Ground Rules • Thereare no “silly” questions. Focus on “why” • Slides with have fundamental concepts • Search on the web for anything you don’t understand • Almost everything is explained reasonably well on the web • You can send questions to [email protected]
  • 3.
    Books – notmandatory • Data and Computer Communications - William Stallings • Internetworking with TCP/IP Volume 1 Principles, Protocols, and Architecture - Douglas E. Comer
  • 4.
    What is Networking? •networking – the exchange of information or services among individuals, groups, or institutions • computer networking – the exchange of information or services among computers
  • 5.
    A Brief History •http://visual.ly/brief-history-computer-network-technology
  • 6.
    Schematic of aComputer Network
  • 7.
    The first hop– wired
  • 8.
    The first hop– wireless
  • 9.
    Wireless First Hop- Possibilities • WLAN/WiFi • Cellular
  • 10.
    Layering – LetsBreak up the Problem TheoreticalPractical
  • 11.
    Wireless First Hop– WiFi • IEEE 802.11 (a/b/g/n/…) standards • Infrastructure mode (common) or Ad hoc mode Ethernet Token Ring New 802.11n
  • 12.
    Connecting to aWiFi Access Point • Scanning • Joining • Authentication • Association • The station feels as if it is “plugged” into a wired network
  • 13.
    Communicating with aWiFi AP • Wireless is a half duplex channel – either speak or listen • Signal strength is inversely proportion to square of distance • Carrier Sense Multiple Access / Collision Avoidance (CSMA/CA) • Fancy name for how humans talk  • This is generally true of all wireless systems (including humans)
  • 14.
  • 15.
    Wireless First Hop– Cellular • Not covered in this course
  • 16.
    Wired First Hop- Ethernet • IEEE 802.3 standard • If two ends of the Ethernet cable (e.g., RJ45) is electrically up, connection is up. • Some authentication steps are usually there but we will skip those
  • 17.
    CSMA/CD • Carrier SenseMultiple Access / Collision Detect
  • 18.
  • 19.
  • 20.
    Getting an IPaddress • DHCP – DHCP clients get IP addresses and networking parameters from DHCP server • Based on BOOTP • DHCPv6 (for IPv6) is also available
  • 21.
    DHCP Packets • Discovery •Offer (possibly multiple) • Request • Acknowledge • Renew • Release Why do we need an IP address?
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
    Got an IP!Hurray! • But now what? How do I “go to” some website? • IP is just an identity • Still need to “route” to somewhere
  • 27.
    DNS – DomainName Service • We almost always try to reach a human readable name • But machines route based on IP addresses • There must be a mapping from names to IP addresses • But who is going to do this translation?
  • 28.
    Default Gateway • Ifhost does not know how to route, who does it ask? • There must be a “goto” guy in the network
  • 29.
    Routing table –Host ubuntu@ubuntu-VirtualBox:~/Projects/OpenStack/New/cinder$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 10.0.2.2 0.0.0.0 UG 0 0 0 eth0 10.0.2.0 * 255.255.255.0 U 1 0 0 eth0 • Routing table becomes very interesting in a core router • 50,000 to 1,00,000 routes (entries like the above table) • We will get to it later
  • 30.
    Who could … •Be a host’s Domain Name Server • Be a host’s Default Gateway
  • 31.
    Are we readyto send?
  • 32.
    ARP – AddressResolution Protocol • What is the MAC address for a given IP? • ARP resolves network layer address to link layer address • Remember network layer is the same as routing layer. This is also known as Layer 3(L3) • Link Layer is Layer 2 (L2)
  • 33.
    Ethernet – IEEE802.3b • Broadcast medium • These days mostly switched Ethernet (point-to-point) • These days mostly Ethernet II • No LLC
  • 34.
  • 35.
  • 36.
    An Example • Wireshark– Download it, install it and then play around with it • Instructions are there on the web itself • Will give you a lot of detail about packets and layering
  • 37.
    DNS – DomainName Service • Hierarchical way of managing name space • Managed by Internet Assigned Numbers Authority (IANA) • http://www.iana.org/domains/root/db
  • 39.
    DNS – RootServers • <a-m>.root-servers.net – 13 hostnames, around 500 instances • Use anycast to reach “nearest” instance – BGP supports this • 12 of the 13 root servers A-M exist in multiple locations • 11 on multiple continents • Root server ‘h’ exists in two U.S. locations. • Root server ‘b’ exists in a single location in the Los Angeles Area • http://www.root-servers.org/
  • 40.
    Subnetting • Routing toeach individual hosts does not scale • Addresses grouped into different classes
  • 41.
    CIDR • Any “classsystem” is bad  • IPv4 was running out of unique IP addresses • Hence IPv6 but… • Classless Inter Domain Routing • Network portion can be of any size • Addresses need to specify subnet mask as well
  • 42.
  • 43.
    NAT – NetworkAddress Translation
  • 44.
  • 45.
  • 46.
    Routing Hierarchy • Internetis divided into Autonomous Systems (AS) • Managed by a single administrator • 16 bit AS Number (ASN)
  • 47.
  • 48.
    Intra-Domain Routing • Typicallyuses UDP • Distance Vector • RIP – Bellman – Ford Algorithm • Link State • OSPF – Dijkstra’s shortest path • ISIS – Dijkstra’s shortest path • Note: The fundamental concept here is Distance Vector and Link State as two types of algorithms, not that they are used for intra-domain routing
  • 49.
    Inter-Domain Routing • BorderGateway Protocol (BGP) – BGP version 4 • Path – vector routing • Uses TCP • External BGP – eBGP • Internal BGP – iBGP • Not to be confused with intra-domain routing (though iBGP could do that ) • Used to send information from one “side” of network to another • Policy engineering
  • 50.
  • 51.
  • 52.
  • 54.
    Transport Layer • Providesend-to-end connection • On top of the routing layer • Two types of transmissions • Unreliable – User Datagram Protocol (UDP) • Reliable – Transmission Control Protocol (TCP)
  • 55.
    UDP • Best effort,connection-less • Just send as fast as possible • When is it okay? • Phone calls, gaming, etc. • Simple stuff like DNS
  • 56.
    TCP • Connection oriented •Setup/teardown connection • Sends stream of bytes, not messages • Reliable and in-order delivery • Flow Control • Congestion Control • Analogous to how humans communicate
  • 57.
    Basics of ReliableConnection • How do you make a transmission reliable? • What do you need to protect against?
  • 58.
    Basics of ReliableConnection Data Ack Sender Receiver time
  • 59.
  • 60.
    TCP – ConnectionSetup • Three-Way Handshake
  • 61.
    TCP Sliding Window •http://www2.rad.com/networks/2004/sliding_window/
  • 62.
    TCP – Beinga Good Citizen • Congestion Control • MaxWindow = min(Congestion Window, Receiver Window) • Congestion Window start at 1 • Original TCP: Additive Increase, Multiplicative Decrease
  • 63.
    Congestion Avoidance Behavior Time Congestion Window Packetloss + Timeout Grabbing back Bandwidth Cut Congestion Window and Rate
  • 64.
    Evolution of TCP 19751980 1985 1990 1982 TCP & IP RFC 793 & 791 1974 TCP described by Vint Cerf and Bob Kahn In IEEE Trans Comm 1983 BSD Unix 4.2 supports TCP/IP 1984 Nagel’s algorithm to reduce overhead of small packets; predicts congestion collapse 1987 Karn’s algorithm to better estimate round-trip time 1986 Congestion collapse observed 1988 Van Jacobson’s algorithms congestion avoidance and congestion control (most implemented in 4.3BSD Tahoe) 1990 4.3BSD Reno fast retransmit delayed ACK’s 1975 Three-way handshake Raymond Tomlinson In SIGCOMM 75 Taken from Aditya Akella’s slides, Dept. of Computer Science, University of Wisconsin - Madison
  • 65.
    TCP Through the1990s 1993 1994 1996 1994 ECN (Floyd) Explicit Congestion Notification 1993 TCP Vegas (Brakmo et al) real congestion avoidance 1994 T/TCP (Braden) Transaction TCP 1996 SACK TCP (Floyd et al) Selective Acknowledgement 1996 Hoe Improving TCP startup 1996 FACK TCP (Mathis et al) extension to SACK Taken from Aditya Akella’s slides, Dept. of Computer Science, University of Wisconsin - Madison
  • 66.
  • 67.
    Ethernet • Original Ethernetused hub – shared ethernet • These days – switched ethernet
  • 68.
    Switched Ethernet • CSMA/ CD • What is collision now? How is it handled?
  • 69.
    Switching Types • Storeand forward • Cut through
  • 70.
    Switched Ethernet –Arbitrary Topology • Can cause loops • Unlike IP header, no TTL to prevent looping
  • 71.
    STP – SpanningTree Protocol • Creates a “tree” that “spans” entire graph • Distributed implementation
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
    STP – LinkFailure
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
    STP Variants • RapidSTP – Converges faster than STP • VLAN STP – Each VLAN can have a different STP tree
  • 82.
    Data Centers • Cloudcomputing – Making computing elastic • Software Defined Networking (SDN) • Universities are using data centers for compute resources • Pay-as-you-go pricing model • Power and Cooling most important 
  • 83.
    Data Centers –Network Properties • Large number of ports • Large number of L2 end points • Multiple VMs per port • Relatively fewer L3 end points • Prime importance - manageability
  • 86.
    Example Equipment –Pictures/Prices • Go to websites such as www.cisco.com and www.juniper.net and look at their product portfolio • www.cisco.com has interactive 3D models • Search for prices on the web
  • 87.
  • 88.
    Industry Expectations • Averageloss $5600/minute  $300K/hour • Zero planned downtime is fast becoming the norm • Can you think of anything similar?
  • 89.
    The Future ofComputer Networks • Manageability • Monitoring • Trouble shooting • Automated Healing • More bandwidth • Energy efficiency • Faster way of implementing something – algorithms/algorithmics • OpenSource based – cheaper and “better” • Broadband access will become a fundamental right