Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Network Layer. Associated Protocols1 Chapter 3 The Network Layer. Associated Protocols Some of these slides are copyrighted by: Computer Networking:

Similar presentations


Presentation on theme: "The Network Layer. Associated Protocols1 Chapter 3 The Network Layer. Associated Protocols Some of these slides are copyrighted by: Computer Networking:"— Presentation transcript:

1 The Network Layer. Associated Protocols1 Chapter 3 The Network Layer. Associated Protocols Some of these slides are copyrighted by: Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April Departamento de Tecnología Electrónica

2 The Network Layer. Associated Protocols2 Chapter 3: Network Layer. Associated Protocols r Chapter goals: r understand advanced principles behind network layer services: m network layer error control m IPv4 address dynamic configuration m routing (path selection) m address translation m advanced topics: IPv6.

3 The Network Layer. Associated Protocols3 Chapter 3: Network Layer. Associated Protocols r 3.1 IPv4 error control: ICMP r 3.2 IPv4 address dynamic configuration: DHCP r 3.3 Routing in the Internet m RIP m OSPF m BGP m Multiprotocol routing r 3.4 Address Translation: NAT r 3.5 IP version 6

4 The Network Layer. Associated Protocols4 Chapter 3: Network Layer. Associated Protocols r 3.1 IPv4 error control: ICMP r 3.2 IPv4 address dynamic configuration: DHCP r 3.3 Routing in the Internet m RIP m OSPF m BGP m Multiprotocol routing r 3.4 Address Translation: NAT r 3.5 IP version 6

5 The Network Layer. Associated Protocols5 ICMP: Internet Control Message Protocol r used by hosts & routers to communicate network-level information m error reporting: unreachable host, network, port, protocol m warnings from routers or receivers r network-layer above IP: m ICMP msgs carried in IP datagrams (but ICMP is not a transport-layer protocol!) r all the nodes using IP must have ICMP implemented r ICMP msgs are only created for the first IP fragment

6 The Network Layer. Associated Protocols6 ICMP: Internet Control Message Protocol r Message format m ICMP msgs carried in IP datagrams Protocol field = 1 in IP header Source IP addr = host sending ICMP msg Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 5 0 ICMP redirect 8 0 echo request (ping) 11 0 TTL expired

7 The Network Layer. Associated Protocols7 ICMP: Internet Control Message Protocol r Ping m Sends data pkt and waits for a response m Based on Type 8 and Type 0 ICMP messages m Functions: Check host connectivity Ping sends pkts with unique seq numbers –Detection ofduplicate, reordered and eliminated pkts Ping use cheksums in every pkt –Detection of corrupted pkts Ping allows RTT (Round Trip Time) calculation Ping allows the detection of other ICMP messages.

8 The Network Layer. Associated Protocols8 ICMP: Internet Control Message Protocol r Ping Echo request and echo reply 1 byte 1 byte 2 bytes | Type | Code | Checksum | | Id | Sequence number | Type: 8 (Echo request) or 0 (Echo reply) Code: 0 Id: number of identificación (optional) Sequence number (optional)

9 The Network Layer. Associated Protocols9 ICMP: Internet Control Message Protocol r Ping Syntax ping [options] destination_host Options -w timeout Timeout in milliseconds to wait for each reply. -i TTL Time To Live. -v TOS Type Of Service. -a Resolve addresses to hostnames. -n count Number of echo requests to send. -t Ping the destination host until interrupted. To see statistics and continue type Control-Break; To stop type Control-C. -l size Send buffer size. -f Set Don't Fragment flag in packet (IPv4-only). -r count Record route for count hops (IPv4-only). -s count Timestamp for count hops (IPv4-only). -j host_list Loose source route along host_list (IPv4-only). -k host_list Strict source route along host_list (IPv4-only). destination_host The name of the remote host -R Use routing header to test reverse route also (IPv6-only). -S srcaddr Source address to use (IPv6-only). -4 Force using IPv4. -6 Force using IPv6

10 The Network Layer. Associated Protocols10 ICMP: Internet Control Message Protocol r Tracert (Trace route) m Source sends echo requests to dest First has TTL =1 Second has TTL=2, etc. m When nth datagram arrives to nth router: Router discards datagram And sends to source an ICMP message (type 11, code 0) Message includes name of router& IP address m Tracert does this 3 times per router Stopping criterion m Echo request eventually arrives at destination host m Destination returns echo reply m When source gets this ICMP, stops.

11 The Network Layer. Associated Protocols11 ICMP: Internet Control Message Protocol r Tracert (Trace route)

12 The Network Layer. Associated Protocols12 ICMP: Internet Control Message Protocol r Destination unreachable (type 3) m Most usual code values (causes) Code 1: host unreachable Code 3: port unreachable Code 4: fragmentation needed

13 The Network Layer. Associated Protocols13 ICMP: Internet Control Message Protocol r ICMP Redirect (type 5) m useful when there are some possible gateways Steps m Packet is sent to default gateway m Default gateway sends packet to router B m Default gateway sends ICMP redirect to host

14 The Network Layer. Associated Protocols14 Chapter 3: Network Layer. Associated Protocols r 3.1 IPv4 error control: ICMP r 3.2 IPv4 address dynamic configuration: DHCP r 3.3 Routing in the Internet m RIP m OSPF m BGP m Multiprotocol routing r 3.4 Address Translation: NAT r 3.5 IP version 6

15 The Network Layer. Associated Protocols15 Dynamic Address Configuration r Address configuration m static m dynamic: automatic and more efficient r Dynamic Address Configuration Protocols m RARP: Reverse Address Resolution Protocol m BootP: Bootstrap Protocol m DHCP: Dynamic Host Configuration Protocol

16 The Network Layer. Associated Protocols16 Dynamic Address Configuration r RARP m RARP: Reverse Address Resolution Protocol m Given a MAC, an IP address is assigned m Messages have the same structure as ARP ones m RARP is limited and, thus, obsolete.

17 The Network Layer. Associated Protocols17 Dynamic Address Configuration r BootP m BootP Protocol: Bootstrap Protocol m Used to obtain IP automatically (generally in boot process) m Not usually utilized for Dynamic Address Configuration, as DHCP is an improved version of BootP. r BootP process m Host determines its own MAC m Host sends its IP to server’s port 67 ( if doesn’t know its IP and if doesn’t’ know the server’s one) m Server searches host’s MAC in a configuration file m Server fills server’s and host’s IPs in UDP datagram and sends it to client’s port 68 m Host saves its IP and boots

18 The Network Layer. Associated Protocols18 Dynamic Address Configuration r BootP message m Code: BootPRequest & BootPReply m Transaction id m HW address: e.g. MAC m Server host name (server does not need to be in the same broadcast domain) m Boot file name m Vendor specific area Magic cookie: shows the kind of optional info below A critical field for DHCP

19 The Network Layer. Associated Protocols19 Dynamic Address Configuration r DHCP Dynamic Host Configuration Protocol (DHCP) – RFC 2131: m Capable of automatically assign reusable (IP address leasing) m Based on BootP, standardizing Vendor Specific Area field in BootP PDU (312 bytes). m 3 mechanisms for the assignment of IP addresses: Automatic assignment: –DHCP assigns a permanent IP address to the host. Dynamic assigment: –DHCP assigns an IP address for a limited period of time -> automatic reuse of non- neccessary IP addresses Static assignment: –IP address assigned by network administrator

20 The Network Layer. Associated Protocols20 Dynamic Address Configuration r DHCP message m Same as BootP message except options field (312 bytes) instead of Vendor Specific Area First four bytes: magic cookie -> (means DHCP). Different options. Most important below –50: requested IP address –51: IP address lease time –53: type of DHCP message

21 The Network Layer. Associated Protocols21 Dynamic Address Configuration r DHCP cycle m 1. DHCP DISCOVER: tries to find a DHCP Server. m 2. DHCP OFFER: the server/s offers an IP address m 3. DHCP REQUEST: the client requests some parameters (generally the ones oferred by the server) m 4. DHCP ACK: server ACK Besides : DHCP RELEASE: releases IP address DHCP DECLINE. The offered IP is in use DHCP INFORM: requests some configuration parameters DHCP NAK: if server does not accept request

22 The Network Layer. Associated Protocols22 Dynamic Address Configuration r Other DHCP features m A router may be a DHCP server m BootP Relay: when the server is not in the same client’s broadcast domain m Gratuitous ARP: ARP request by the client of its own IP. Checks if the assigned IP is busy. m Option 50: client requests a fixed IP m Option 51: IP address lease time m Maximum DHCP message size: 576 bytes

23 The Network Layer. Associated Protocols23 Chapter 3: Network Layer. Associated Protocols r 3.1 IPv4 error control: ICMP r 3.2 IPv4 address dynamic configuration: DHCP r 3.3 Routing in the Internet m RIP m OSPF m BGP m Multiprotocol routing r 3.4 Address Translation: NAT r 3.5 IP version 6

24 The Network Layer. Associated Protocols24 Routing in the internet r Network layer functions m Addressing m Routing r Routing: finding the BEST route m Best route depends on different criteria: # of hops, transfer rate, load of a link, cost, reliability… m Different routes Link breakage Slow links

25 The Network Layer. Associated Protocols25 Routing in the internet r Two approaches in routing m Virtual circuit Route is established in connection start m Datagram Rcvr addr is inside every packet Concept: Autonomous System (AS) r AS: IP networks with a common routing management

26 The Network Layer. Associated Protocols26 Virtual circuit vs. Datagram r Virtual circuit m Error & flow control; order maintenance m Connection oriented Three phases: establishment, transfer & termination m Advantages Efficiency QoS r Datagram m Each packet is an independent unit Dest addr in every packet Packets may arrive disordered to dest No error or flow control m Advantages More simple No connection -> better for short-time tx More reliable Better for heterogeneous networks

27 The Network Layer. Associated Protocols27 Packet flow r Unicast r Broadcast r Multicast

28 The Network Layer. Associated Protocols28 A B C D E F 4 flows 2 flows Unicast r Individual flows: one tx, one rx

29 The Network Layer. Associated Protocols29 Broadcast r one tx, everyone rx A B C D E F 1 flow

30 The Network Layer. Associated Protocols30 Multicast r one flow, only desired rx A B C D E F 1 flow

31 The Network Layer. Associated Protocols31 Unicast routing r Objective m Carry pkts from sender to receiver r Network-layer routing m Hierarchic addressing: first finds network & the host r Routing algorithm m Router calculates the way of routing r Routing algorithm features m Correct m Simple m Robust m Fair m Optimum

32 The Network Layer. Associated Protocols32 Routing algorithms r Router m Network device that interconnects networks & implements routing algorithm m Routing algorithm decides which interface is correct Router Input gateways Output gateways Routing Table Routing Engine

33 The Network Layer. Associated Protocols33 Routing algorithms r Classification m Static routing m Adaptive routing Centralized Isolated Distributed: most used on the internet (RIP/OSPF)

34 The Network Layer. Associated Protocols34 Static Routing r Does not consider current network condition r Routes are determined before starting network service r Advantages m Simple m Good results for constant traffic and network topology r Disadvantages m Not suitable for networks with changing topology m Not suitable for big networks -> not scalable

35 The Network Layer. Associated Protocols35 Adaptive Routing r Decisions based on m Current topology m Network condition (congested links) r Better than static routing but more difficult to implement r Three subgroups m Centralized Adaptive Routing m Isolated Adaptive Routing m Distributed Adaptive Routing

36 The Network Layer. Associated Protocols36 Centralized Adaptive Routing r Routing Control Center (RCC) r Nodes (routers) send info about their condition to RCC m List of neighbour nodes m Queue length m Use of links r RCC m Receives the information m Calculates optimum route for every two nodes m Calculates routing table for every node m Distributes tables to nodes r Disadvantages m RCC & links to RCC -> bottlenecks m Inaccurate calculation

37 The Network Layer. Associated Protocols37 Isolated Adaptive Routing r No info interchange between nodes r Decisions based only on local info -> simple r Example m Flooding

38 The Network Layer. Associated Protocols38 Distributed Adaptive Routing r Used on the internet r Two subgroups m Distance vector algorithms Decisions based on the information received from neighbour nodes E.g. RIP (Routing Information Protocol) m Link state algorithms All the nodes know the state of the network Some time to propagate changes E.g. OSPF (Open Short Path First)

39 The Network Layer. Associated Protocols39 RIP: Routing Information Protocol r Routing Information Protocol (RIP) – RFC 1058 (RIP), RFC 1723 (RIPv2): r Routing Protocol (application- layer protocol over UDP – port 520 -) r Used for interior routing inside an AS r RIPv2 is identical to RIP, but with two extensions: m Allows CIDR m Authentication mechanism r Metric: hop counts r Maximum number of hops -> 15 r Better for homogeneous networks r Routing table distance vector-based r Routing table updates: m Periodic updates: via broadcast (in RIPv2: multicast to ) m Updates when network topology changes

40 The Network Layer. Associated Protocols40 RIP: Routing Information Protocol RIP functioning r Update from neighbour N arrives to a router R: m Networks known by N, and not by R, are included in R’s routing table. m If N knows a better route for a network known by both, R’s routing table is updated m Metric (# of hops) is increased by one m Router R publishes information increasing in one unit what it is introduced in its routing table. m Update messages tx to neighbours. Two ways Not using split horizon technique: Updates are sent to all the neighbours. Using split horizon technique. Updates sent to all the neighbours, except to those who informed about the best route.

41 The Network Layer. Associated Protocols41 RIP: Routing Information Protocol RIP timers r Routing-update timer: 30 seconds – random time r Route-timeout timer: after timeout -> invalid route r Route-flush timer: after timeout -> deletes route from enrouting table

42 The Network Layer. Associated Protocols42 RIP: Routing Information Protocol RIP message r Command m Request (1) m Response (2): most common (updates) r Version: v1 or v2 r RIP version 2: most important field -> subnet mask -> allows CIDR (subnetting)

43 The Network Layer. Associated Protocols43 OSPF: Open Short Path First Open Short Path First (OSPF) r Used for interior routing inside an AS r Larger networks than RIP (usually) r Open protocol (RFC 2328)

44 The Network Layer. Associated Protocols44 OSPF: Basic Foundations Open Short Path First (OSPF) r Link state routing protocol r Dijkstra algorithm to find the BEST route r A router builds a graph r Graph weights are configured by the network administrator m All equal to 1 (similar to RIP) m Inversely proportional to BW (usual criterium) m Any criteria may be fixed Open Short Path First (OSPF) r Updates disseminated to entire AS (via flooding) m Changes in topology m Periodically (once every 30 min, at least) r carried in OSPF messages directly over IP (rather than TCP or UDP) -> protocol field: 89 r Link connectivity is checked by HELLO msgs for neighbours

45 The Network Layer. Associated Protocols45 OSPF advanced features (not in RIP) r security: all OSPF messages authenticated r For each link, multiple cost metrics for different TOS r hierarchical OSPF in large domains.

46 The Network Layer. Associated Protocols46 OSPF header r Checksum: error control r Authentication ValueType 1HELLO 2Database description 3Link state request 4Link state update 5Link state ACK

47 The Network Layer. Associated Protocols47 BGP: Border Gateway Protocol r Problem: Different IP networks do not have to use same routing protocol r Two types of protocols m IGP (Interior Gateway Protocols): define routing inside an AS. (RIP, OSPF…) m EGP (Exterior Gateway Protocols): define routing between different AS. r BGP (Border Gateway Protocol): most common EGP (RFC 4271)

48 The Network Layer. Associated Protocols48 BGP: Main features r BGP provides each AS means to: 1. Obtain subnet reachability information from neighboring ASs. 2. Propagate reachability information to all AS- internal routers. r allows subnet to advertise its existence to rest of Internet

49 The Network Layer. Associated Protocols49 BGP: Main features r Every AS: ASN = Autonomous System Number) r Inside every AS -> AS routing protocol r Outside AS -> “border router”: border routers in different AS exchange their routing tables r BGP works over TCP (port 179)

50 The Network Layer. Associated Protocols50 BGP: Example

51 The Network Layer. Associated Protocols51 Multiprotocol routing r IP is not the only network-layer protocol (IPX, DecNET, Apple Talk…) r Only hosts using the same network-layer protocol can communicate with each other r Multiprotocol routers prevent from using different routers for every protocol

52 The Network Layer. Associated Protocols52 Chapter 3: Network Layer. Associated Protocols r 3.1 IPv4 error control: ICMP r 3.2 IPv4 address dynamic configuration: DHCP r 3.3 Routing in the Internet m RIP m OSPF m BGP m Multiprotocol routing r 3.4 Address Translation: NAT r 3.5 IP version 6

53 The Network Layer. Associated Protocols53 Address Translation: NAT r Problem: limited number of IP addr. r Solutions o Subnetting o Private IP addr / / / /16

54 The Network Layer. Associated Protocols54 Address Translation: NAT r Private IP addr: how can the dest know whose is the private IP addr? r Solution: NAT (Network Address Translation) o Mechanism used to modify the IP addr inside pkts o Allows private IP addr (inside networks) communication with public IP addr (outside networks) o NAT routers must keep a NAT table with translation in both directions

55 The Network Layer. Associated Protocols55 NAT basic functioning  NAT Router has one or more IP addr for NAT -> for translating private IP into public IP  NAT Router modifies “Source IP addr” field in the IP header & stores matching public & pvt addr in the NAT Table  Dest responds to modified addr  NAT Router searches on its NAT Table & matches public & pvt addr, sending the pkt to the pvt IP

56 The Network Layer. Associated Protocols56 Types of NAT  Dynamic NAT  Static NAT  NAPT (Network Address Port Translation)

57 The Network Layer. Associated Protocols57 Dynamic NAT  Translation is unidirectional  Traffic comes from the inside network  Translation is temporary  Once public IP addr is not in use, it is deleted from NAT Table

58 The Network Layer. Associated Protocols58 Dynamic NAT r Advantage m Saves public IP addr r Disadvantage m Traffic always initiated from the inside network -> does not allow servers

59 The Network Layer. Associated Protocols59 Static NAT r Translations are in the NAT Table since routers are configured r Communication may be initiated by both the inside & the outside networks r Public IP addr must be known (via DNS) by the hosts in the outside network

60 The Network Layer. Associated Protocols60 Static NAT r Advantage m Allows servers r Disadvantage m One public IP addr per pvt IP addr… but both dynamic & static NAT may be used together

61 The Network Layer. Associated Protocols61 NAPT r Transport-Layer Port Identifiers are used r Several pvt IP addr may be translated into a unique public IP addr

62 The Network Layer. Associated Protocols62 About NAT r Not every app work properly when going through a NAT router (e.g, BOOTP) r Difficult to follow the traffic that goes through several NAT routers r NAT increases router processing time r NAPT is a type of NAT -> there are also dynamic NAPT & static NAPT. Both may also be used together

63 Chapter 3: Network Layer. Associated Protocols r 3.1 IPv4 error control: ICMP r 3.2 IPv4 address dynamic configuration: DHCP r 3.3 Routing in the Internet m RIP m OSPF m BGP m Multiprotocol routing r 3.4 Address Translation: NAT r 3.5 IP version 6 The Network Layer. Associated Protocols63

64 The Network Layer. Associated Protocols64 IPv6 r Initial motivation: 32-bit address space completely allocated. r Basic changes: m 128-bit address space E.g: 2002:96d6:8ddc::96dc:6301 (the bits remaining are zeros) m header format helps speed processing/forwarding m 40-byte header (fixed size) m Other changes based on previous experience on IPv4

65 The Network Layer. Associated Protocols65 IPv6 header Version: 6 Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Payload length: data field length Next header: identify upper layer protocol for data Hop limit: analog to IPv4 TTL field Src & Dest addr: 128 bytes

66 The Network Layer. Associated Protocols66 Changes from IPv4 r Checksum: removed entirely to reduce processing time at each hop r Fragmentation: removed from IPv6, also to reduce processing time r Options: allowed, but outside of header, indicated by “Next Header” field r ICMPv6: new version of ICMP m additional message types, e.g. “Packet Too Big”

67 The Network Layer. Associated Protocols67 Transition from IPv4 to IPv6 r Not all routers can be upgraded simultaneous m no D Day m How will the network operate with mixed IPv4 and IPv6 routers? r Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers


Download ppt "The Network Layer. Associated Protocols1 Chapter 3 The Network Layer. Associated Protocols Some of these slides are copyrighted by: Computer Networking:"

Similar presentations


Ads by Google