Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Network Layer Unit 4.

Similar presentations


Presentation on theme: "The Network Layer Unit 4."— Presentation transcript:

1 The Network Layer Unit 4

2 Design Issues Store‐and‐Forward Packet Switching
restating the context of network layer protocols Services Provided to the Transport Layer Implementation of Connectionless Service Implementation of Connection‐Oriented Service Comparison of Virtual‐Circuit and Datagram Subnets

3 Store and Forward Packet Switching
Customer equipment (outside the oval) Carrier’s equipment: routers connected by transmission lines

4 Packet Switching Data is divided into small parts (packets)
Packets are transmitted from node to node, processed and forwarded Also known as store‐and‐forward switching Two connection types Connectionless: datagram Connection‐oriented: virtual circuit

5 Services Provided to Transport Layer
Services should be independent of router technology Topology of network should be hidden Network addresses available to transport layer should use be uniform, even across LANs and WANs Network layer designers have freedom in writing specs of services to transport layer

6 Connection‐Oriented or Connectionless? Two competing camps
Internet community: connectionless routers job is moving packets and nothing else subnet is inherently unreliable hosts should provide error & flow control Telephone companies: connection‐oriented subnet should provide reliable service successful experience with telephone system without connections, QoS is hard to achieve

7 Implementation of Connectionless Service

8 Implementation of Connectionless Service
No connection setup Message is broken into packets Called datagram (in analogy with telegram) Each packet is individually routed Routers decides line based on routing table Packets may follow different paths Not guaranteed to arrive in order

9 Implementation of Connection‐Oriented Service
Path from source to destination must be established before any data can be sent Connection is called a VC (virtual circuit) analogy with physical circuit in phone system why virtual? Avoid choosing new route for each packet Same route used for all packets in connection Each packet has ID for which VC it belongs to

10 Implementation of Connection‐Oriented Service

11 Example: Connection‐Oriented
H1 has established connection 1 with H2 First entry in each routing table H3 later establishes connection with H2

12 Example: Connection‐Oriented
A can easily know connection 1 packets of H1 from connection 1 packets of H3 C cannot do this Thus, A assigns different connection ID to outgoing traffic for second connection To avoid conflicts, routers need ability to replace connection IDs in outgoing packets This is called label switching

13 Routing Algorithms The main function of the network layer is routing packets from the source machine to the destination machine. The routing algorithm is that part of the network layer software responsible for deciding which output line an incoming packet should be transmitted on. If the subnet uses virtual circuits internally, routing decisions are made only when a new virtual circuit is being set up. Thereafter, data packets just follow the previously-established route. The latter case is sometimes called session routing because a route remains in force for an entire user session It is sometimes useful to make a distinction between routing, which is making the decision which routes to use, and forwarding, which is what happens when a packet arrives. One can think of a router as having two processes inside it. One of them handles each packet as it arrives, looking up the outgoing line to use for it in the routing tables. This process is forwarding.

14 Shortest Path Routing One way of measuring path length is the number of hops. Using this metric, the paths ABC and ABE in Figure are equally long. Another metric is the geographic distance in kilometers, in which case ABC is clearly much longer than ABE (assuming the figure is drawn to scale). Figure : The first five steps used in computing the shortest path from A to D. The arrows indicate the working node.

15

16 Flooding Every incoming packet is sent out on every outgoing line except the one it arrived on. Flooding obviously generates vast numbers of duplicate packets, in fact, an infinite number unless some measures are taken to damp the process. One such measure is to have a hop counter contained in the header of each packet, which is decremented at each hop, with the packet being discarded when the counter reaches zero. An alternative technique for damming the flood is to keep track of which packets have been flooded, to avoid sending them out a second time. achieve this goal is to have the source router put a sequence number in each packet it receives from its hosts. Each router then needs a list per source router telling which sequence numbers originating at that source have already been seen. If an incoming packet is on the list, it is not flooded. A variation of flooding that is slightly more practical is selective flooding. In this algorithm the routers do not send every incoming packet out on every line, only on those lines that are going approximately in the right direction. There is usually little point in sending a westbound packet on an eastbound line unless the topology is extremely peculiar and the router is sure of this fact.

17 Distance Vector Routing
Distance vector routing algorithms operate by having each router maintain a table (i.e, a vector) giving the best known distance to each destination and which line to use to get there. These tables are updated by exchanging information with the neighbors. As an example the first four columns of part (b) show the delay vectors received from the neighbors of router J. A claims to have a 12-msec delay to B, a 25-msec delay to C, a 40-msec delay to D, etc. Suppose that J has measured or estimated its delay to its neighbors, A, I, H, and K as 8, 10, 12, and 6 msec respectively. Consider how J computes its new route to router G. It knows that it can get to A in 8 msec, and A claims to be able to get to G in 18 msec, so J knows it can count on a delay of 26 msec to G if it forwards packets bound for G to A. Similarly, it computes the delay to G via I, H, and K as 41 ( ), 18 (6 + 12), and 37 (31 + 6) msec, respectively. The best of these values is 18, so it makes an entry in its routing table that the delay to G is 18 msec and that the route to use is via H. The same calculation is performed for all the other destinations, with the new routing table shown in the last column of the figure.

18

19 Routing Routing is the process of selecting best paths in a network. In the past, the term routing also meant forwarding network traffic among networks. Routing is performed for many kinds of networks, including the telephone network (circuit switching), electronic data networks (such as the Internet), and transportation networks. Broadcast Routing: In some applications, hosts need to send messages to many or all other hosts. For example, a service distributing weather reports, stock market updates, or live radio programs might work best by broadcasting to all machines and letting those that are interested read the data. Sending a packet to all destinations simultaneously is called broadcasting

20

21 Multicast Routing Some applications require that widely-separated processes work together in groups, for example, a group of processes implementing a distributed database system. In these situations, it is frequently necessary for one process to send a message to all the other members of the group. If the group is small, it can just send each other member a point-to-point message. Sending a message to such a group is called multicasting, and its routing algorithm is called multicast routing.

22

23 Congestion control algorithm

24

25 Error detection and correction
There are many reasons such as noise, cross-talk etc., which may help data to get corrupted during transmission. Types of Errors There may be three types of errors: Single bit error In a frame, there is only one bit, anywhere though, which is corrupt. Multiple bits error Frame is received with more than one bits in corrupted state. Burst error Frame contains more than1 consecutive bits corrupted. Error control mechanism may involve two possible ways: Error detection Error correction

26 Error Detection Errors in the received frames are detected by means of Parity Check and Cyclic Redundancy Check (CRC). In both cases, few extra bits are sent along with actual data to confirm that bits received at other end are same as they were sent. Parity Check One extra bit is sent along with the original bits to make number of 1s either even in case of even parity, or odd in case of odd parity. The sender while creating a frame counts the number of 1s in it. For example, if even parity is used and number of 1s is even then one bit with value 0 is added. This way number of 1s remains even . If the number of 1s is odd, to make it even a bit with value 1 is added. The receiver simply counts the number of 1s in a frame. If the count of 1s is even and even parity is used, the frame is considered to be not-corrupted and is accepted. If the count of 1s is odd and odd parity is used, the frame is still not corrupted. If a single bit flips in transit, the receiver can detect it by counting the number of 1s. But when more than one bits are erro neous, then it is very hard for the receiver to detect the error.

27 Cyclic Redundancy Check (CRC)
CRC is a different approach to detect if the received frame contains valid data. This technique involves binary division of the data bits being sent. The divisor is generated using polynomials. The sender performs a division operation on the bits being sent and calculates the remainder. Before sending the actual bits, the sender adds the remainder at the end of the actual bits. Actual data bits plus the remainder is called a codeword. The sender transmits data bits as code words. At the other end, the receiver performs division operation on code words using the same CRC divisor. If the remainder contains all zeros the data bits are accepted, otherwise it is considered as there some data corruption occurred in transit.

28 Error Correction In the digital world, error correction can be done in two ways: Backward Error Correction  When the receiver detects an error in the data received, it requests back the sender to retransmit the data unit. Forward Error Correction  When the receiver detects some error in the data received, it executes error-correcting code, which helps it to auto-recover and to correct some kinds of errors. The first one, Backward Error Correction, is simple and can only be efficiently used where retransmitting is not expensive. For example, fiber optics. But in case of wireless transmission retransmitting may cost too much. In the latter case, Forward Error Correction is used. To correct the error in data frame, the receiver must know exactly which bit in the frame is corrupted. To locate the bit in error, redundant bits are used as parity bits for error detection . For example, we take ASCII words (7 bits data), then there could be 8 kind of information we need: first seven bits to tell us which bit is error and one more bit to tell that there is no error.

29 Internetworking In real world scenario, networks under same administration are generally scattered geographically. There may exist requirement of connecting two different networks of same kind as well as of different kinds. Routing between two networks is called internetworking. In internetworking, routers have knowledge of each other’s address and addresses beyond them. They can be statically configured go on different network or they can learn by using internetworking routing protocol.

30 Tunneling If they are two geographically separate networks, which want to communicate with each other, they may deploy a dedicated line between or they have to pass their data through intermediate networks. Tunneling is a mechanism by which two or more same networks communicate with each other, by passing intermediate networking complexities. Tunneling is configured at both ends.

31 The IP Protocol An IP datagram consists of a header part and a text part. The header has a 20-byte fixed part and a variable length optional part. The header format is shown in Figure.

32 The Version field keeps track of which version of the protocol the datagram belongs to.
Since the header length is not constant, a field in the header, IHL, is provided to tell how long the header is, in 32-bit words. The Type of service field is one of the few fields that has changed its meaning (slightly) over the years. The Total length includes everything in the datagram—both header and data. The maximum length is 65,535 bytes. The Identification field is needed to allow the destination host to determine which datagram a newly arrived fragment belongs to. The Fragment offset tells where in the current datagram this fragment belongs.

33 Address Resolution Protocol
Although every machine on the Internet has one (or more) IP addresses, these cannot actually be used for sending packets because the data link layer hardware does not understand Internet addresses . let us use the example of Figure , in which a small university with several class C (now called /24) networks is illustrated. Here we have two Ethernets, one in the Computer Science Dept., with IP address and one in Electrical Engineering, with IP address These are connected by a campus backbone ring (e.g., FDDI) with IP address Each machine on an Ethernet has a unique Ethernet address, labeled E1 through E6, and each machine on the FDDI ring has an FDDI address, labeled F1 through F3. The upper layer software on host 1 now builds a packet with in the Destination address field and gives it to the IP software to transmit. The IP software can look at the address and see that the destination is on its own network, but it needs some way to find the destination's Ethernet address. One solution is to have a configuration file somewhere in the system that maps IP addresses onto Ethernet addresses. While this solution is certainly possible, for organizations with thousands of machines, keeping all these files up to date is an error-prone, time-consuming job.

34 A better solution is for host 1 to output a broadcast packet onto the Ethernet asking: Who owns IP address ? The broadcast will arrive at every machine on Ethernet , and each one will check its IP address. Host 2 alone will respond with its Ethernet address (E2). In this way host 1 learns that IP address is on the host with Ethernet address E2. The protocol used for asking this question and getting the reply is called ARP (Address Resolution Protocol). Almost every machine on the Internet runs it. ARP is defined in RFC 826.

35 RARP ARP solves the problem of finding out which Ethernet address corresponds to a given IP address. Sometimes the reverse problem has to be solved: Given an Ethernet address, what is the corresponding IP address? The first solution devised was to use RARP (Reverse Address Resolution Protocol) . This protocol allows a newly-booted workstation to broadcast its Ethernet address. Using RARP is better than embedding an IP address in the memory image because it allows the same image to be used on all machines. A disadvantage of RARP is that it uses a destination address of all 1s (limited broadcasting) to reach the RARP server. However, such broadcasts are not forwarded by routers, so a RARP server is needed on each network.

36 IP Address and Classification
IP, Short for Internet Protocol, is an address of a computer or other network device on a network using IP or TCP/IP ( Transmission Control Protocol / Internet Protocol ). For Example, the number " " is an example of such an address. These addresses are similar to addresses used on houses and help data reach its appropriate destination on a network. There are five classes of available IP ranges: Class A, Class B, Class C, Class D and Class E, while only A, B and C are commonly used. Each class allows for a range of valid IP addresses. Below is a listing of these addresses.

37


Download ppt "The Network Layer Unit 4."

Similar presentations


Ads by Google