90
INTRODUCTION TO COMPUTER NETWORKING Amit Saha IIT Gandhinagar 13 th , 14 th March 2015

Introduction to Computer Networking

Embed Size (px)

Citation preview

INTRODUCTION TO COMPUTER NETWORKINGAmit SahaIIT Gandhinagar13th, 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 [email protected]

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$ routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault 10.0.2.2 0.0.0.0 UG 0 0 0 eth010.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

CongestionWindow

Packet loss+ Timeout

Grabbingback

Bandwidth

CutCongestion

Windowand Rate

Evolution of TCP

1975 1980 1985 1990

1982TCP & IP

RFC 793 & 791

1974TCP described by

Vint Cerf and Bob KahnIn IEEE Trans Comm

1983BSD Unix 4.2

supports TCP/IP

1984Nagel’s algorithm

to reduce overheadof small packets;

predicts congestion collapse

1987Karn’s algorithm

to better estimate round-trip time

1986Congestion collapse

observed

1988Van Jacobson’s algorithmscongestion avoidance and

congestion control(most implemented in

4.3BSD Tahoe)

19904.3BSD Reno

fast retransmitdelayed ACK’s

1975Three-way handshake

Raymond TomlinsonIn SIGCOMM 75

Taken from Aditya Akella’s slides, Dept. of Computer Science, University of Wisconsin - Madison

TCP Through the 1990s

1993 1994 1996

1994ECN

(Floyd)Explicit

CongestionNotification

1993TCP Vegas

(Brakmo et al)real congestion

avoidance

1994T/TCP

(Braden)Transaction

TCP

1996SACK TCP

(Floyd et al)Selective

Acknowledgement

1996Hoe

Improving TCP startup

1996FACK 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