31
N ew York Institute ofTechnology Engineering and C om puterSciences Kazi Spring 2008 CSCI 690 1 CSCI-690 Computer Networks Khurram Kazi

Kazi Spring 2008 CSCI 6901 CSCI-690 Computer Networks Khurram Kazi

  • View
    227

  • Download
    1

Embed Size (px)

Citation preview

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 1

CSCI-690

Computer Networks

Khurram Kazi

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 2

Reference Network: For discussion purposes

Router A

Router B

Router C

Router D

Router F

Router E

LAN 1

LAN 2

Wide Area Network or Metro Area Network

Edge Router

Edge Router

Source of IP Traffic

Destination of IP Traffic (server)

Shows traffic flow

ip addr

ip addr

ip addr

ip addr

ip addr

ip addr

ip addr

ip addr

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 3

Routing Algorithms

• The Optimality Principle• Shortest Path Routing• Flooding• Distance Vector Routing• Link State Routing• Hierarchical Routing• Broadcast Routing• Multicast Routing• Routing for Mobile Hosts• Routing in Ad Hoc Networks

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 4

Routing

Routing and forwarding is what the Internet is all about

How can an IP packet from one host be delivered to the destination host?Within an individual router lies the answer:

Routing TableRouting table maps the destination address

carried in a datagram to the address of the next hop along the path (next hop address) and the interface through which the datagram should be forwarded (the outgoing interface)

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 5

Routing In simple networks, routing table can be manually configured or

learned from the configuration of interfaces on the router. In complex networks where there are many routers arranged in

a mesh with lots of links between routers, each having different capabilities, manual configuration becomes onerous/troublesome.

Even more important is when there are changes in the network – how do other routers are informed of such changes and how they react to the change. e.g. Link failure, routers added to the network

Routing protocols are used to collate and distribute information about the network connectivity Once the connectivity information has been distributed the

question of how to compute the best path still remains. Routing algorithms can be run against the view of the network to

determine the best path along which to forward the datagram.

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 6

Routing

Routing Information Protocol (RIP) is simple and ubiquitous.

Open Shortest Path First (OSPF) protocol is very popular and has a close rival, Intermediate System to Intermediate System (IS-IS), that performs a similar function

Border Gateway Protocol (BGP) is important for hooking together the many Service Provider networks into a single Internet

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 7

Classless Interdomain Routing (CIDR)

IP addresses are grouped in classes Different nibbles/bytes split the address into network portion and the host portion

of the IP address Network mask indicates the length of the network part of the address – know as

prefix length Earlier networks routed traffic based on the classes (A, B or C type) Subnetting allows the networks to be divided into smaller segments Subnetting process defines range of addresses assigned to a subnet according

to prefix length Routing using subnetwork addresses is not quite simple as routing as using

class addresses, because knowledge of the network mask (prefix length) is not encoded in the address itself

Routing table must consist of a list of subnetwork addresses (i.e. addresses and prefix length), each mapping to a route or path along which packet for that subnet should be forwarded

Routing table will explode if all addresses have to be included in the routing table. e.g., in class A potentially there are 222 30-bit prefix subnetworks, and there are possible 128 class A networks

The solution within the Internet is to route at an appropriate level of granularity through address aggregation

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 8

Route address aggregation

Subnetwork Subnetwork Mask Address Range

172.19.168.16/28 255.255.255.240 172.19.168.16 – 172.19.168.31

172.19.168.32/28 255.255.255.240 172.19.168.32 – 172.19.168.47

172.19.168.32/27 255.255.255.224 172.19.168.1 – 172.19.168.62

The subnet addresses can be combined/aggregated as a single subnetwork 176.19.168.32/26

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 9

Route address aggregation

Care needs to be taken in choosing subnetwork addresses that are assigned to domains and customer networks. By careful selection, network operators may significantly reduce routing table entries on the routers in their core networks

Aggregation should be done such that the addresses be accessed by the same router

The assignment of subnetwork addresses within a larger network becomes a hierarchical distribution problem

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 10

Autonomous Systems Who owns the internet (one happy family)

Wide variety of organizations National governments Large Internet Service Providers (ISPs) Telephone companies with wide geographic footprint

In the real world, each organization wants the largest possible amount of control and secrecy Each organizational grouping of computers/servers defines itself as an

Autonomous System (AS) AS can operate in isolation from all other groupings Within an AS, routing information is generally widely distributed One router can clearly see the path through the AS network to another

router within the same AS Protocols that distribute routing information within as AS is referred as

Interior Gateway Protocols (IGPs). The word gateway is the old name for a router

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 11

Autonomous Systems

Organizations and Ass require connectivity to make the Internet work

Connectivity operates in a largely hierarchical way Home users and small companies paying smaller ISPs

for private access (dial-up, wireless, leased lines, cable etc.)

Smaller ISPs and larger corporations buy access to the backbone network operated by larger ISPs

The larger ISPs create a peering agreement with each other to glue the whole thing together

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 12

Autonomous Systems Just the connectivity is not enough Must have the ability to route from a router in one AS to a router

in another AS Key to this is the routers that sit on the links between Ass These Autonomous Systems Border Routers (ASBRs) are

responsible for leaking routing information from one AS to another AS

These routers do not divulge too much information about their internal network infrastructure

They reveal just enough information such that IP packets can be routed to the hosts that AS supports

Such routing protocols are called Exterior Gateway Protocols (EGPs) EGPs distribute reachability information in terms of

subnetted and aggregated IP addresses and unique AS indentifiers called AS numbers

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 13

Autonomous Systems within the InternetAutonomous System

EGP Link

Connection to Other Autonomous System

IGP LinkASBR

Customer Network

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 14

Building and Using a Routing Table

Mostly routers have to perform one major functionGiven an IP Datagram carrying a specific

destination host address, out of which interface should the datagram be

sent and to which next hop

The answer to this question is relevant on interfaces that lead to multi-access links where the data-link layers is called on to deliver the datagram to the correct next hop router or host

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 15

Building and Using a Routing Table

A routing table is some form of look-up algorithms that takes an IP address and derives an interface identifier and a next hop IP address

Implementation of routing table varies from vendor to vendor This is one of the features vendors can claim their competitive edge over

another Routing table can be considered an ordered list

When the table is searched for a particular address there maybe several entries that match the address, however, only one is entry can be chosen and used for any one packet

Typically router searches for the route that matches the longest prefix from the destination address – the explicit route to the directly attached host matches all the 32 bits and is selected in preference to the default route which has a netmask of 0.0.0.0 or a prefix match of zero bits.

Mostly the routing table ordering lists the entries for longer prefixes higher up in the table, a first-match rule can be applied with the router selecting the first route that matches the destination address

Routing table can be very large and include many subnetwork routes Search through the table could take a long time Efficient search algorithms exist Assignment: Look up couple of search algorithms and write a brief report

on it

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 16

Simple network showing a multi-access link, a numbered point-to-point link and an un-numbered link

Router XRouter ID = 17

Loopbck = 172.168.28.1

172.168.25.4

172.168.25.1

172.168.25.2

172.168.25.3

Router YRouter ID = 2003

Loopbck = 172.168.28.2

Router ZRouter ID = 172.168.28.3Loopbck = 172.168.28.2

172.168.25.25

172.168.25.24/30 172.168.25.26

#19

#4

172.168.25.0/28 (Subnet address)

Numbered link

Loop back address is known as a routable router identifier because it is an IP address that can be installed in the routing tables at other routers

.

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 17

Distance Vectors

Router A

10.0.1.1

10.0.2.1

10.0.3.1

10.0.1.2

10.0.6.1

10.0.4.1 10.0.4.2

10.0.2.2 10.0.3.2

Router B

Router C

Router E Router F

Router D

10.0.6.210.0.7.1 10.0.7.2 10.0.8.2

10.0.8.1

10.0.5.1

10.0.5.2

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 18

Distance Vector Simplest and most intuitive way to distribute network

connectivity information also makes the construction of routing tables easier

Distance Vector Protocols come under that category At times these protocols are called routing by rumor Routers talk to each other and exchange information about

the routes through the network that they know about, and in time, all of the best paths

Refer to figure in next slide, the idea behind this is: Router A would send a message down to each of its attached links

saying, “I am here and I am directly connected to this link.” It does not know who or what is connected on the other side of the

link. No problem: The receiver on that link now knows, if it receives a message for router A, it can send it on that particular link that they received the message on.

This now becomes an entry in the routing table E.g. Router B would have a single entry in its tables that says.

“Send to Router A out of interface 10.0.1.2

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 19

Distance Vector

Each router after receiving the information from Router A, forwards its connectivity to router A along with its own connectivity to other routers E.g. Router C, hears from Router A, and tells Router B

and D, “I am here and I am directly connected to you. Also I am one hop away from Router A

Now Router B knows how to reach Router C and A. Router B has two possible paths to router A. How does it select which path?It can be as simple as how many hops is it away from

the Router A. Select the path that has the lowest number of hops!!

This information it receives from the different messages it received which allow it to select the optimum route and install it in its routing table

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 20

Routing Table at Router E. Initial routing Distribution while the link between Routers A and B Disabled

Destination Outgoing Interface

Distance Next Hop

E 10.0.0.1 0 -

B 10.0.6.2 1 B

F 10.0.7.1 1 F

C 10.0.6.2 2 B

D 10.0.7.1 2 F

A 10.0.7.1 3 F

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 21

Routing Table at Router E. After Full Distribution

Destination Outgoing Interface

Distance Next Hop

E 10.0.0.1 0 -

B 10.0.6.2 1 B

F 10.0.7.1 1 F

C 10.0.6.2 2 B

D 10.0.7.1 2 F

A 10.0.7.1 2 B

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 22

Failure detected and how is its information propagated What if link between Routers B and C fails and the failure is

detected by router B Router B retires any routes that use that link It stops advertising those routes to its neighbors There are two possibilities

Router A advertises its connectivity to Router B and says it is one hop away from Router C

Router B now uses this new route information to connect to Router C.

Router B advertises to Router E the new routing information about C

Router E looks at it, might discard the information since it has a higher hop count to C. However, since this information is coming from the same link, hence updates its routing table!!

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 23

Failure detected and how is its information propagated After router withdrawal, the routing tables can become repopulated if each router

re-advertises its routing table In distance vector routing, every router runs a timer and periodically re-

advertises all of its routing information– this can fill the gaps left by the withdrawn routes

Re-advertisement on a timer is useful as it is a way for the ensure that everyone’s routing table is up-to-date and helps detect network errors E.g., Router B fails; Link to Router E is active, so Router E continues to send all

data for Router A via Router B, where the data is lost Since Router E knows that Router B should re-advertise its routing information

periodically, it can spot that Router B has gone quiet and tin-out all routes that were previous advertised by Router B

Each router runs a timer for each route in its routing table If timer expires, it treats that event as withdrawal or link failure, marking that route

unavailable and immediately passing on the rumor Process far from ideal since the timer must be large enough not to overreact to

occasional packet loss (i.e. lost advertisement) and must take account of how frequently (or in-frequently) the routers perform background advertisement

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 24

Internet Control Message Protocol (ICMP) ICMP is carried inside an IP datagram Is considered to be at the internet layer (network layer)

ICMP is fundamental to the operation of IP networks and is so closely related to IP that it is not possible to operate hosts within an IP network without supporting ICMP

Used by the routers to identify the hosts and other routers: Most commonly ICMP is used for Sending error message about unreachable destinations Sending error and status messages about routes and

gateways Sending echo requests and replies to indicate status of

reachable hosts Sending error message about traffic that has “timed-out”

(TTL drops too low)

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 25

ICMP Message format

0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

Octet 1 Octet 2 Octet 3 Octet 4

Version IHL Type of Service Total Length

Identification Flags Fragment Offset

Source Address

Destination Address

Checksum

ICMP message Field

IP Header

Time to Live Protocol Header Checksum

Message Type Message Code

ICMP Message

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 26

ICMP MessagesMessage Type Message

0 Echo reply. Sent in direct response to an ICMP echo request message

3 Destination Unreachable. An error message sent when a node cannot forward any IP datagram towards its destination

4 Source Quench. Sent by a destination node to slow down the rate at which a source node sends IP datagrams

5 Redirect. Used to tell a source node that there is a better first hop for it to use when trying to send IP datagrams to a given destination.

8 Echo. Sent by a node to probe the network for reachability to a particular destination

9 Router Advertisement. Used by a router to tell hosts in its network that it exists and is ready for service.

10 Router Solicitation. Used by a host to discover which routers are available for use.

11 Time Exceeded. An error message generated by a router when it cannot forward an IP datagram because the TTL has expired.

12 Parameter Problem. An error sent by any node that discovers a problem with an IP datagram it has received

13 Timestamp Request. Used to probe the network for the transmission and processing latency of message to a give destination.

14 Timestamp Reply. Used in direct response to a Timestamp Request Message

15 Information request. Used by a host to discover the subnet to which its is attached.

16 Information Reply. Used in direct response to an Information Request message

17 Address Mask request. Used by a host to discover the subnet mask for the network to which it is attached

18 Address Mask Reply. Used in direct response to an Address Mask Request message.

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 27

ICMP

Ground rules for ICMP ICMP message cannot generate ICMP error messages ICMP cannot generate broadcast or multicast messages These rules help avoid “broadcast storms” that can easily

flood a network Unreachability Message

Indicate that there has been a failure somewhere in the process of addressing the datagram that triggers the message. For example, incorrectly addressed datagrams will cause

unreachable messages to be sentMore often, if a host is simply turned off or even when the

specified protocol is not available (e.g., trying to connect to a network application port that is prohibited or restricted).

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 28

ICMP ICMP Routing Messages

Routing messages include requests for a list of available routers and replies that include list of other available routers along with a priority number for each router.

Hosts sometimes make these requests when they boot up to initialize their routing tables

Routers advertise gateways when they bootup. Routers also periodically broadcast this information. Another type of routing message is generated when a router

becomes overloaded, whether from high-volume stream of traffic from a single host or from a generally high load due to many hosts.

ICMP message may carry routing information when a host sends traffic to one router and a different router advertises a better route (route with fewer hops). This is called redirect. Commonly happens on networks with more than one router, where the hosts start out with only a single router in their routing tables

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 29

ICMP

Ping and ICMP Echo Messages Ping (or PING) is named from Packet InterNet Groper

Ping sends an ICMP echo request out to a specific host, and the host responds to ICMP echo requests by sending out an ICMP echo reply

Represents the simple level of connectivity possible between two hosts on an internetwork

Useful for testing whether a remote host is reachable or whether the network connection for a local host is properly configured and installed

Command has the format Ping < IP host name | IP address >

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 30

Traceroute (“tracert” command DOS)

Used to attempt to trace the route between two hosts on an internetwork Uses TTL field and multiple passes to collect information. Starts with a TTL of 1, the neighboring router drops that packet and

sends back an ICMP message Sends the next packet with TTL of 2. This allows the packet to go to the

second hop. The second hop router sends an ICMP message back to the origination host that indicates that the offending datagram expired on the network

The origination host keeps on increasing the TTL until it has all the relevant information it is looking for about the route between it and the destination host.

Examining the list of nodes that returned errors gives us the path through the network to the destination.

Examining the turnaround time for the error messages gives a measure of which hops in the network are consuming how much time

New York Institute of Technology

Engineering and Computer Sciences

Kazi Spring 2008 CSCI 690 31

Assignment 4: Due April 17

Assignment: As per slide 16 look up couple of search algorithms and write a brief report on them

You need to present it. You can take about 15 minutes for the presentation