10/13/2015© 2008 raymond p. jefferis iiilect 07 1 internet protocol

55
06/14/22 © 2008 Raymond P. Jefferis III Lect 07 1 Internet Protocol

Upload: frank-damon-mcbride

Post on 31-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 1

Internet Protocol

Page 2: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 2

What is the Internet?

• A collection of separate networks

• Interconnected by routers and gateways– routers interconnect similar networks– gateways interconnect differing networks

Page 3: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 3

Connectionless Functions

• Unicasting of datagramseach datagram routed from source to destination

• Multicasting of datagramssingle datagram routed to many destinations

Page 4: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 4

Internet Protocol (IP)

• A connectionless (datagram) service

• Supports connectionless transport (TCP)(TCP also supports connection-oriented

transport)

Page 5: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 5

Internet Protocol Routing

• Allows interconnection of subnetworks within a Local Area Network

• Allows interconnection of Local Area Networks

Page 6: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 6

Subnet Interconnection

Workstation

Workstation

Hub Router

Workstation

Workstation

Hub

Subnet Subnet

Page 7: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 7

Router

• Interconnects subnets

• Many ports, each on separate subnet

• Operates at Network Layer

• Restricts traffic - only subnet traffic visible

• Can interconnect Local Area Networks (LANs)

Page 8: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 8

Hub

• Interconnects hosts on subnet

• Many ports, all on same subnet

• Operates at Data Link Layer

• Does not restrict traffic (all traffic visible)

Page 9: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 9

LAN Interconnection

Workstation

Workstation

Hub Router

Workstation

Workstation

Hub

Network 1 Network 2

OtherSubnets

Router

OtherSubnets

Router

OtherNetworks

Page 10: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 10

Larger Networks

• Wide Area Networks (WANs)

• May operate with different protocols

• Gateway couples these

• Internet is an example

Page 11: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 11

WAN Interconnection

Workstation

Workstation

Hub Router

Workstation

Workstation

Hub

Network 1 Network 2

OtherSubnets

Router

OtherSubnets

Router

Gateway

Internet

Page 12: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 12

Effect on Application Data

• TCP adds header at transport layer

• IP adds header at network layer

Page 13: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 13

TCP/IP Header Embedding

Page 14: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 14

Addressing of Network Nodes• Physical address (Ethernet address)

– Medium Access Control (MAC) format• 6 octets (uniquely assigned to hardware)

• Network address– Internet Protocol (IP) format

• 4 octets (assigned by agency)

• Translation– Address Resolution Protocol (ARP)– Reverse Address Resolution Protocol (RARP)

Page 15: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 15

Physical (Hardware) Address

• MAC (Medium Access Control) address

• 6 octets (48 bits) Note: 248 = 2.8147x1014

– 3 octets of vendor code (Assigned by IEEE)• 1 octet of flag bits

• 2 octets of vendor number

– 3 octets of serial number (Assigned by vendor)

Page 16: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 16

MAC Address Format

Page 17: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 17

Network (IP) Address

• 4 octets (32 bits) Note: 232 = 4.2950x109

• Left octet(s) are Network address• leftmost bits signify address class

• next bits are network address

• Right octets are Host addressHost addresses may be subnetted

• left bits are Subnet

• rightmost bits are Host

Page 18: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 18

Network Address Classes

Page 19: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 19

Example

• Widener University - Class B address147.31.xxx.yyy

Page 20: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 20

Addressing limits

• Class A (Super WAN - e.g. country)– 27 networks, 224 hosts (3 octets)

• Class B (WAN/LAN)– 214 networks, 216 hosts (2 octets)

• Class C (LAN)– 221 networks, 28 hosts (1 octet)

(Note: all address octets can be 0 to 255 )

Page 21: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 21

Subnets

• Needed to make efficient use of addresses

• Reduce routing effort by assigning a single address to all the subnets

• Resolve local traffic locally; keep Intra-net traffic off the Inter-net

• Organize hosts into groups (LANs)

Page 22: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 22

Example Class B Subnet

Note that the Subnet divides the Host address space

Subnet mask will contain 1s in Subnet space; 0s in Host space

A 9-bit host space is assumed (510 hosts)

A 7-bit subnet space remains (126 subnets)

Note: Addresses 0 and 255 are reserved

Page 23: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 23

Subnet Masks

• Router will AND mask with IP address and pass result through to local network– Example: 254 hosts (H) in subnet (S)

• IP address is: N.N.S.H

• subnet mask is: 255.255.255.0

– Example: 510 hosts (H) in subnet (S)• IP address is: N.N.S-H.H

• subnet mask is: 255.255.254.0

Page 24: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 24

Subnet Calculators

• Simplify binary subnet calculations

• Are available free on the Internet

• Search on “subnet calculator”

• Example:– http://www.subnet-calculator.com/

Page 25: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 25

Host Mask Design Procedure• Specify expected number of hosts (N)

– all computers– printers– network devices (hubs, routers, etc.)– add 2 (for reserved 0 and 255 addresses)

• Set k to next power of 2 giving at least N addresses

• Mask is 1s complement of 2k-1

Page 26: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 26

Address Translation

• IP to HardwareAddress Resolution Protocol (ARP)

• Hardware to IPReverse Address Resolution Protocol (RARP)

Page 27: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 27

ARP/RARP Overview

Page 28: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 28

ARP Request Packet

Page 29: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 29

Address Translation Procedure

• Source computer to send• Outgoing packet is put in queue

• Special ARP request packet is broadcast on network

• Target computer responds• Target computer returns packet with missing

address

• Note: its “target” is original “source” computer

• Source computer sends queued packet

Page 30: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 30

147.31.232.120 To Send

Hardware Address Protocol Address

Source 00:20:af:c4:1d:2a 147.31.232.120

Destination 00:00:00:00:00:00 147.31.232.100

This packet will be broadcast to every host on 147.31.232.0 network (subnet)

Only 147.31.232.100 responds (unicast response)

Page 31: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 31

147.31.232.100 Answers

Hardware Address Protocol Address

Source 00:80:72:00:61:dc 147.31.232.100

Destination 00:20:af:c4:1d:2a 147.31.232.120

147.31.232.120 now has the hardware address it needs to build packets to 147.31.232.100.

Page 32: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 32

Name Translation

• Name to IP-Address(engr.widener.edu => 147.31.230.10)

• Domain Name Server (DNS)– a hierarchy of database servers on the network– local resolution attempted first; then network– secondary (backup), usually available

Page 33: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 33

IP Header

Page 34: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 34

IP Header Fields• Version (4 bits)

– version number

• Header Length (4 bits)– in 32-bit words (5 is minimum)

• Type of Service (8 bits)– Precedence (bits 0-2) – Throughput (bit 4)– Delay (bit 3) – Reliability (bit 5)– bits 6 & 7 reserved for future use

Page 35: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 35

IP Header Fields (Cont’d)• Total length

– length of datagram, including header [bytes]– design minimum: 576 bytes

• Identification– sequence number for fragments

• Flags (3 bits)– bit 0 = 0 (reserved) bit 2 = more fragments– bit 1 = don’t fragment

Page 36: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 36

IP Header Fields (Cont’d)

• Fragment offset (13 bits)– location of fragment in datagram (8-byte units)

• Time to live [seconds]– each router must count down by one

• Protocol type– for higher level processing of datagram– (TCP = 6, UDP = 17)

Page 37: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 37

IP Header Fields (Cont’d)

• Source address (32 bits)– IP address

• Destination address (32 bits)– IP address

• Options– all devices must implement– typical: security, upper level protocols, etc.

Page 38: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 38

ICMP

• Internet Control Message Protocol

• Conveys return error messages to source from an IP network

• No retransmission if lost

Page 39: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 39

ICMP Header Format

Page 40: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 40

Some ICMP Types & CodesTYPE CODE DESCRIPTION

0 Echo reply3 Destination unreachable3 0 Network unreachable3 1 Host unreachable3 2 Protocol unavailable3 3 Port unreachable3 4 Fragmentation needed4 Source quench5 Redirect

11 Time exceeded11 0 Time to live exceeded15 Information request16 Information reply

Page 41: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 41

Some ICMP Interpretations

• Destination unreachable(router can’t find route)

• Source quench(reduce source rate)

• Time exceeded(TTL decremented to zero by router)

Page 42: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 42

Routing Methods

• Distance Vector Protocol(uses RIP - Routing Information Protocol)Bellman-Ford routing algorithm

• Link State Protocol(uses OSPF - Open Shortest Path First)SPF routing algorithm (Dijkstra)All routers know complete network

Page 43: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 43

RIP - Routing Information Protocol

• A distance vector protocol

• Uses hop count as metric (1 - 16)

• Peer routers exchange distance vectors every 30 seconds

• Router considered off-line if timeout exceeded (180 seconds)

• Problematic above subnet level

Page 44: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 44

RIP2 (RIP) Header

Note: White area repeats for each router addressed.

Page 45: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 45

RIP Commands

Request: For all or part of routing table of target router (destination address - via next-hop)

Response: All or part of routing table from target router - or update

COMMAND DESCRIPTION

1 Request

2 Response

Page 46: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 46

RIP Version NumberVERSION DESCRIPTION

0 Ignore datagram1 Check 0-fields2 Newly defined fields

>2 Ignore 0-fields

Page 47: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 47

OSPF - Open Shortest Path First

• An internal link state routing protocol

• Hierarchical routing by “areas”

• Link State Protocol (LSP) packets advertise routes

• Routers can advertise 1-hop hosts as sets

• One router of broadcast LAN is the“designated” router; failover to “backup”

Page 48: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 48

More OSPF Features

• Allows multiple route definitions– by service types– by costs– by load (allows load balancing)

• Secures router databases– all data exchanges authenticated– only authenticated data can be propagated

Page 49: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 49

Weighted Digraph Representation

• Vertices– routers– networks

• Edges– paths

• to routers

• to networks

– corresponding costs

Page 50: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 50

OSPF Packet Format

Page 51: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 51

OSPF Fields

• Version Number• at present, always 1

• Packet Type• 1 = Hello

• 2 = Database Description

• 3 = Link State Request

• 4 = Link State Update

• 5 = Link State Acknowledgment

Page 52: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 52

OSPF Fields (cont’d)

• Packet length, including header [bytes]

• Source router address (ID)

• Area ID– Note: packets usually cover only 1 hop

• Checksum (1s complement)

• Authentication type

• Authentication field (64-bit)

Page 53: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 53

Link State Tables

• Destination ID

• Next Hop ID

• Distance Metric– delay– data rate– unit cost ($)– combination

Page 54: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 54

Network Routing Diagram

N9 N5

N3

Router

R13 1

7

5

4

1

Router

R2

Page 55: 10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol

04/19/23 © 2008 Raymond P. Jefferis III Lect 07 55

SPF Routing Table for R2

Destination Next Hop Metric

N3 N3 1

N5 N5 4

R1 R1 7

N9 N5 4