30
Networking Networking An Introduction An Introduction

Networking An Introduction. History of the Internet ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Embed Size (px)

Citation preview

Page 1: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

NetworkingNetworking

An IntroductionAn Introduction

Page 2: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

History of the InternetHistory of the Internet

ARPAnetARPAnet• Advanced Research Project AgencyAdvanced Research Project Agency• First four nodes – 1969First four nodes – 1969• Connect supercomputersConnect supercomputers

DARPAnetDARPAnet• Defense Advanced Research Project Defense Advanced Research Project

AgencyAgency• Replaced ARPA and took over networkReplaced ARPA and took over network

Page 3: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

History of Internet (2)History of Internet (2)

NSFnetNSFnet• Merged NSF network and DARPAnet Merged NSF network and DARPAnet

when defense community moved to when defense community moved to more secure network. (Internet)more secure network. (Internet)

• Early 1990’s, administration of Internet Early 1990’s, administration of Internet moves to public utilities.moves to public utilities.

†Based upon Null and Lobur, Computer Organization and Architecture, Jones and Barttlett, 2003.

Page 4: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Characteristics of InternetCharacteristics of Internet

Originally designed to survive Originally designed to survive thermonuclear warthermonuclear war

Adopted datagrams that could be Adopted datagrams that could be individually routedindividually routed

Uniform protocol over dissimilar Uniform protocol over dissimilar hardwarehardware

Philosophy of free and open Philosophy of free and open information interchangeinformation interchange

Page 5: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

TCP/IP ProtocolTCP/IP Protocol

Three layered protocolThree layered protocol• Process layerProcess layer

Application uses protocol from TCP/IP suite Application uses protocol from TCP/IP suite FTPFTP HTTPHTTP STMPSTMP TELNETTELNET

• TCP layerTCP layer• IP layerIP layer

Page 6: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

TCP/IP ArchitectureTCP/IP Architecture

User data

User dataTCP

Header

User dataTCP

HeaderIP

Header

User dataTCP

HeaderIP

HeaderNetworkHeader

Application

TCP Segment

IP Datagram

Network Layer (e.g. Ethernet)

†Based upon Stallings, Data and Computer Communications, Prentice-Hall, 1997.

Page 7: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IPIP

Internet ProtocolInternet Protocol Two versionsTwo versions

• IPv4IPv4• IPv6IPv6

Divides packets into units called Divides packets into units called datagramsdatagrams

Adds Routing InformationAdds Routing Information Purpose – route datagrams over Purpose – route datagrams over

networknetwork

Page 8: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IP RoutingIP Routing

`

`

Datagram 1

Datagram 1

Datagram 2

Send Message

Receive Message

Page 9: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IPv4 Datagram HeaderIPv4 Datagram Header Header length - minimum of 5 - 32 bit words Header length - minimum of 5 - 32 bit words Word 1Word 1

• Version – IP versionVersion – IP version• Header Length – in 32 bit words (min is 5)Header Length – in 32 bit words (min is 5)• Type of Service - priorityType of Service - priority• Total Length of datagram – total length (65,535 max)Total Length of datagram – total length (65,535 max)

Word 2Word 2• Packet Id – number assigned as placed on networkPacket Id – number assigned as placed on network• Flags – can packet be broken to smaller fragmentsFlags – can packet be broken to smaller fragments• Fragment offset – offset of fragment in original datagramFragment offset – offset of fragment in original datagram

Page 10: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IPv4 Datagram Header (2)IPv4 Datagram Header (2)

Word 3Word 3• Time to Live (TTL) – number of hops left Time to Live (TTL) – number of hops left

in datagram lifetimein datagram lifetime• Protocol Number – higher level protocol Protocol Number – higher level protocol

sending packetsending packet• Header ChecksumHeader Checksum

Word 4 – Source IP address Word 4 – Source IP address Word 5 – Destination IP address Word 5 – Destination IP address Word 6 – IP optionsWord 6 – IP options

Page 11: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IPv4 Address ClassesIPv4 Address Classes

Three Classes of addressesThree Classes of addresses• Class A networkClass A network• Class B networkClass B network• Class C networkClass C network

IP address 32 bits longIP address 32 bits long Uses dotted decimal notationUses dotted decimal notation

• 4 groups each representing 8 bits4 groups each representing 8 bits• E.g. 168.47.23.8E.g. 168.47.23.8

Page 12: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Class A NetworksClass A Networks FormatFormat

• 0|Network|Host0|Network|Host• High bit: 0High bit: 0• Network: 7 bitsNetwork: 7 bits• Host: 24 bitsHost: 24 bits

Reserved networksReserved networks• 127.x.x.x – loop back address127.x.x.x – loop back address• 0.0.0.0 – default route0.0.0.0 – default route

126 Networks 126 Networks • 0.x.x.x to 127.x.x.x0.x.x.x to 127.x.x.x

Each has 2Each has 224 (24 (16.7 million) nodes16.7 million) nodes 10.x.x.x is internal network number10.x.x.x is internal network number

Page 13: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Class B NetworksClass B Networks

FormatFormat• High two bits: 10High two bits: 10• Network: 14 bitsNetwork: 14 bits• Host 16 bitsHost 16 bits

221414 (16,382) networks (16,382) networks• 128.0.x.x to 191.255.x.x128.0.x.x to 191.255.x.x

221616-2 (65,534)hosts per network-2 (65,534)hosts per network 168.x.x.x is internal IP 168.x.x.x is internal IP

Page 14: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Class C NetworkClass C Network

FormatFormat• High three bits: 110High three bits: 110• Network: 21 bitsNetwork: 21 bits• Host 8 bitsHost 8 bits

222121 (2,097,152)Networks (2,097,152)Networks• 192.0.0.x to 223.255.255.x192.0.0.x to 223.255.255.x

2288 (256) Hosts per network (256) Hosts per network 192.x.x.x is an internal network 192.x.x.x is an internal network

numbernumber

Page 15: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IPv4 ProblemsIPv4 Problems

65,536 byte packet is too small65,536 byte packet is too small• Can pass router in 1Gb network in less than 1 Can pass router in 1Gb network in less than 1

msms Too few AddressesToo few Addresses

• 126 Class A with 16.7 million nodes each – too 126 Class A with 16.7 million nodes each – too large large

• Class C address has only 256 nodes – too smallClass C address has only 256 nodes – too small Typical Backbone routing table must Typical Backbone routing table must

contain ~70,000+ routescontain ~70,000+ routes

Page 16: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Transmission Control ProtocolTransmission Control Protocol TCP uses services provided by IPTCP uses services provided by IP More sophisticated than IPMore sophisticated than IP TCP opens a connection – conservationTCP opens a connection – conservation Service Access Port Service Access Port

• SAP - numericalSAP - numerical• Socket - SAP, host ID, and protocol designationSocket - SAP, host ID, and protocol designation• Ports 0 – 1023Ports 0 – 1023

Well known portsWell known ports Use is reserved (e.g. 23 used by Telnet)Use is reserved (e.g. 23 used by Telnet)

• Ports 1024 – 65,535Ports 1024 – 65,535 User definedUser defined

Page 17: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Transmission Control ProtocolTransmission Control Protocol

Is reliableIs reliable TCP assuresTCP assures

• Proper sequenceProper sequence• No duplicatesNo duplicates• Overflow prevented (transmission Overflow prevented (transmission

speed)speed)• Connection-orientedConnection-oriented• Retransmission of lost dataRetransmission of lost data

Page 18: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

TCP: Three-way HandshakeTCP: Three-way Handshake

Open ConnectionOpen Connection• SYN – SynchronizeSYN – Synchronize

ACK – AcknowledgeACK – Acknowledge Note the Note the

acknowledgement of acknowledgement of each msgeach msg

Negotiate connection Negotiate connection w. sequence numbers w. sequence numbers next seq# t+2 for A, next seq# t+2 for A, and j+2 for Band j+2 for B

Establishes connectionEstablishes connection

A B

SYN = True, SEQ#=j

SYN = True, SEQ#=t

ACK = True, ACK#=j+1

ACK = True, ACK#=t+1

Time

Page 19: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Windows and Payload SizeWindows and Payload Size

WindowWindow• Number of bytes to send between Number of bytes to send between

acknowledgementsacknowledgements• i.e. send window size bytes before i.e. send window size bytes before

expecting an ACK to be returnedexpecting an ACK to be returned Payload SizePayload Size

• Number of bytes sent in each packetNumber of bytes sent in each packet Negotiated after connection is Negotiated after connection is

establishedestablished

Page 20: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

TCP Data TransferTCP Data TransferWindow = 500 bytes

Payload = 100 bytes

A BSEQ#=0

ACK, ACK#=100

SEQ#=100

ACK, ACK#=100

SEQ#=200SEQ#=300

SEQ#=100

SEQ#=200

ACK, ACK#=200

A can now send packets 300to 600 w/o acknowledgement

Page 21: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

TCP Segment FormatTCP Segment Format Word 1Word 1

• Source Port – 16 bitsSource Port – 16 bits• Destination Port – 16 bitsDestination Port – 16 bits

Word 2 – Sequence NumberWord 2 – Sequence Number Word 3 – Acknowledgement NumberWord 3 – Acknowledgement Number Word 4Word 4

• Data Offset – Number of 32-bit words in headerData Offset – Number of 32-bit words in header• ReservedReserved• Flags – URG, ACK, PSH, RST, SYN, FINFlags – URG, ACK, PSH, RST, SYN, FIN• Window – 16 bitsWindow – 16 bits

Word 5Word 5• Checksum – 16 bitsChecksum – 16 bits• Urgent Pointer 16 bitsUrgent Pointer 16 bits

Word 6 OptionsWord 6 Options

Page 22: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IPv6 ProtocolIPv6 Protocol

Addresses the Class B ProblemAddresses the Class B Problem IPv4 – 2IPv4 – 23232 addresses addresses IPv6 – 2IPv6 – 2128 128 addressesaddresses

• 22128128 - 1 oz NIC - 1 oz NIC → → 1.61 quadrillion x mass 1.61 quadrillion x mass earthearth

• That’s enough addresses!That’s enough addresses! Requires management Requires management Implementation by 2010Implementation by 2010

Page 23: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IPv6 Address OrganizationIPv6 Address Organization

Aggregatable Global Unicast Address Aggregatable Global Unicast Address FormatFormat

OrganizationOrganization• High 3 bits – flag indicating AGUA addr.High 3 bits – flag indicating AGUA addr.• Next 13 bitsNext 13 bits

Top-Level Aggregation (TLA) ID Top-Level Aggregation (TLA) ID Country, major global telecomm carrierCountry, major global telecomm carrier

• Next 8 bits –Reserved (growing room)Next 8 bits –Reserved (growing room)• Next 24 bitsNext 24 bits

Level Aggregation (NLA) IDLevel Aggregation (NLA) ID Large company, government, ISPLarge company, government, ISP

Page 24: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

IPv6 Address Organization (2)IPv6 Address Organization (2)

• Next 16 bitsNext 16 bits Site-Level Aggregation IdSite-Level Aggregation Id Can break up addresses into 65,536 sub-netwroksCan break up addresses into 65,536 sub-netwroks

• Next 64 bitsNext 64 bits Specify hostSpecify host Each sub-network can have 2Each sub-network can have 26464 hosts hosts

Stateless Address AutoconfigurationStateless Address Autoconfiguration• Use 48 bit MAC addressUse 48 bit MAC address• Completes address with net. info. from nearby Completes address with net. info. from nearby

router router Prevents address spoofingPrevents address spoofing Has a transitional phaseHas a transitional phase

Page 25: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Network DevicesNetwork Devices Hub Hub

• Physical layerPhysical layer• Input port copied to all output portsInput port copied to all output ports• Non-switched EthernetNon-switched Ethernet

SwitchesSwitches• Create point-to-point connection between input port and Create point-to-point connection between input port and

one output portone output port• Switched EthernetSwitched Ethernet

BridgesBridges• Both networks must be same typeBoth networks must be same type

GatewaysGateways• Point of entrance to a networkPoint of entrance to a network• Connects networks using different protocolsConnects networks using different protocols

Page 26: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

RoutersRouters

Connected to at least two networksConnected to at least two networks Determines the destination to which Determines the destination to which

a packet should be senta packet should be sent Layer 3 DeviceLayer 3 Device

• Switch at the OSI Network layerSwitch at the OSI Network layer• Can bridge different network mediaCan bridge different network media

Computer that implements a routing Computer that implements a routing algorithmalgorithm

Page 27: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

RoutingRouting NP-complete problemNP-complete problem

• Consider a complete graphConsider a complete graph• Number of simple paths between any two nodes – N!Number of simple paths between any two nodes – N!

Add finding the best pathAdd finding the best path Best Best

• Shortest?Shortest?• Fastest?Fastest?

Routing information must be kept dynamicallyRouting information must be kept dynamically Very hard but important taskVery hard but important task Types of Routing AlgorithmsTypes of Routing Algorithms

• Distance-Vector RoutingDistance-Vector Routing• Link State RoutingLink State Routing

Page 28: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Distance Vector RoutingDistance Vector Routing

`

B

`

D

`

T

`

A

`

W

`

L

`

M

`

N

`

R

`

C

4 1

3 2

r

Each router keeps Each router keeps tabletable

TableTable• DestDest• Next HopNext Hop• Hop CountHop Count

Routers exchange Routers exchange hop information hop information with each neighborwith each neighbor

Based upon Fig. 11.21 from Null, Computer Organization and Architecture, Jones & Bartlett, 2003

Page 29: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Distance Vector Routing TablesDistance Vector Routing Tables

DestDest NextNext

HopHopHopHop

CountCount

AA ---- 00

BB R4R4 11

CC R2R2 11

DD R4R4 11

LL R4R4 22

MM R4R4 22

NN R4R4 22

RR R2R2 11

TT ---- 00

WW ---- 00

DestDest NextNext

HopHopHopHop

CountCount

AA R3R3 11

BB R3R3 22

CC ---- 00

DD R3R3 22

LL R1R1 11

MM R1R1 11

NN R1R1 11

RR ---- 00

TT R3R3 11

WW R3R3 11

DestDest NextNext

HopHopHopHop

CountCount

AA R2R2 22

BB R4R4 11

CC R2R2 11

DD R4R4 11

LL ---- 00

MM ---- 00

NN ---- 00

RR R2R2 11

TT R4R4 22

WW R4R4 22

Router 3 Router 2 Router 1

Based upon Fig. 11.21 from Null, Computer Organization and Architecture, Jones & Bartlett, 2003

Page 30: Networking An Introduction. History of the Internet  ARPAnet Advanced Research Project AgencyAdvanced Research Project Agency First four nodes – 1969First

Distance Vector Routing ProblemsDistance Vector Routing Problems

Long time for routing tables to Long time for routing tables to stabilizestabilize

Considerable traffic to keep tables Considerable traffic to keep tables updatedupdated

Obsolete routesObsolete routes• Count-to-infinity problemCount-to-infinity problem• Cycles in the routing can cause each to Cycles in the routing can cause each to

keep updating hop count until infinite keep updating hop count until infinite value resultsvalue results