Sie sind auf Seite 1von 32

Routing Fundamentals and Subnets

Network Technology II Bridging

Routing Fundamentals and Subnets

page 1 of 32

Routable and routed protocols


A protocol is a set of rules that determines how computers communicate with each other across networks A protocol describes the following:
The format that a message must conform to . The way in which computers must exchange a message within the context of a particular activity.

A routed protocol allows the router to forward data between nodes on different networks.
The reason that a network mask is used is to allow groups of sequential IP addresses to be treated as a single unit.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 2 of 32

IP as a routed protocol
The Internet Protocol (IP) is the most widely used implementation of a hierarchical network-addressing scheme. IP is a connectionless (no need for call setup), unreliable (no error control), and best-effort delivery (no bandwidth control) protocol. At the network layer, the data is encapsulated into packets, also known as datagrams. IP determines the contents of the IP packet header, which includes addressing and other control information, but is not concerned with the actual data.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 3 of 32

Layer 3 data units, packets, are for end-to-end addressing. As the data crosses a Layer 3 device the Layer 2 information changes. Address checked to see if Broadcast or to Router Interface Frame accepted.
CRC Checked. Packet sent to Layer 4. If destined for other IP or Gateway. Frame given appropriate info and new FCS.

Packet propagation and switching within a router

Sent out correct interface.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 4 of 32

Internet Protocol (IP)


Connectionless
Destination is not contacted before packet is sent. Packets may take different paths to reach destination, therefore the packets may not arrive in order. Packet Switched, e.g. Postal System.

Connection Oriented
Connection established before data Tx. Circuit Switched. Packets follow same path (circuit) sequentially, e.g. Phone system

The Internet is a gigantic (big), connectionless network. All packet deliveries are handled by IP. TCP adds Layer 4, connectionoriented, reliable (with error control) services to IP.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 5 of 32

Anatomy (structure) of an IP packet


IP packets consist of the data from upper layers plus an IP header. The IP header consists of the following:
Version Indicates the version of IP currently used; four bits. If the version field is different than the IP version of the receiving device, that device will reject the packets. IP header length (HLEN) Indicates the datagram header length in 32-bit words. This is the total length of all header information, accounting for the two variable-length header fields. Type-of-service (TOS) Specifies the level of importance that has been assigned by a particular upper-layer protocol, eight bits. Total length Specifies the length of the entire packet in bytes, including data and header, 16 bits. To get the length of the data payload subtract the HLEN from the total length. Identification Contains an integer that identifies the current datagram, 16 bits. This is the sequence number. Flags A three-bit field in which the two low-order bits control fragmentation. One bit specifies whether the packet can be fragmented, and the other specifies whether the packet is the last fragment in a series of fragmented packets.
** Note that fragmenting the packet means break down a large packet into several small packets.
Network Technology II Bridging Routing Fundamentals and Subnets page 6 of 32

Anatomy of an IP packet (Contd)


Fragment offset Used to help piece together datagram fragments, 13 bits. This field allows the previous field to end on a 16-bit boundary (3 bits flag + 13 bits fragment=16 bits). Time-to-live (TTL) A field that specifies the number of hops (routers) a packet may travel. This number is decreased by one as the packet travels through a router. When the counter reaches zero the packet is discarded. This prevents packets from looping endlessly. Protocol indicates which upper-layer protocol, such as TCP or UDP, receives incoming packets after IP processing has been completed, eight bits. Header checksum helps ensure IP header integrity, 16 bits. Source address specifies the sending node IP address, 32 bits. Destination address specifies the receiving node IP address, 32 bits. Options allows IP to support various options, such as security, variable length. Padding(fill up the space) extra zeros are added to this field to ensure that the IP header is always a multiple of 32 bits. Data contains upper-layer information, variable length up to 64 Kb.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 7 of 32

Routing overview
Routing takes place in the Network layer. Routing allows individual addresses to be grouped together. Routing finds most efficient path from one device to another. Routers provide 2 key functions
Maintain routing tables and network topology (utilizes routing protocol). Provide mechanisms for finding correct path (path determination).

Routers use metrics for path determination


Hop Count, Delay, Bandwidth, Reliability, Cost, Load Most common routable protocol is the Internet Protocol (IP). Other routable protocols include: IPX/SPX and AppleTalk - These protocols provide Layer 3 support. Non-routable protocols do not provide Layer 3 support - The most common non-routable protocol is NetBEUI. NetBEUI is a small, fast, and efficient protocol that is limited to frame delivery within one segment.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 8 of 32

Routing versus switching


Switches are Layer 2 devices
Maintain ARP tables and MAC addresses for local broadcast domain.

Routers are Layer 3 devices


Maintain IP and MAC tables for connected networks. Routers block broadcasts. Routers provide higher security and bandwidth control than switches.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 9 of 32

Routed versus routing


Routed protocols transport data across a network.
Includes any network protocol suite that provides enough information in its network layer address to allow a router to forward it to the next device and ultimately to its destination. Defines the format and use of the fields within a packet. The Internet Protocol (IP) and Novell's Internetwork Packet Exchange (IPX) are examples of routed protocols. Other examples include DECnet, AppleTalk, Banyan VINES, and Xerox Network Systems (XNS).

Routing protocols allow routers to choose the best path for data from source to destination.
Provides processes for sharing route information. Allows routers to communicate with other routers to update and maintain the routing tables. Examples of routing protocols that support the IP routed protocol include the Routing Information Protocol (RIP), Interior Gateway Routing Protocol (IGRP), Open Shortest Path First (OSPF), Border Gateway Protocol (BGP), and Enhanced IGRP (EIGRP).
Network Technology II Bridging Routing Fundamentals and Subnets page 10 of 32

Path determination
Path determination enables a router to compare the destination address to the available routes in its routing table, and to select the best path.
Static routing configured by administrator. Dynamic routing learned automatically from other routers and devices.

The destination address is obtained from the packet. The mask of the first entry in the routing table is applied to the destination address. The masked destination and the routing table entry are compared. If there is a match, the packet is forwarded to the port that is associated with that table entry. If there is not a match, the next entry in the table is checked. If the packet does not match any entries in the table, the router checks to see if a default route has been set. If a default route has been set, the packet is forwarded to the associated port. A default route is a route that is configured by the network administrator as the route to use if there are no matches in the routing table. If there is no default route, the packet is discarded. Usually a message is sent back to the sending device indicating that the destination was unreachable.
Network Technology II Bridging Routing Fundamentals and Subnets page 11 of 32

Routing tables
Routers use routing protocols to build and maintain routing tables that contain route information.
Routing tables include the following: Protocol type The type of routing protocol that created the routing table entry. Destination/next-hop associations These associations tell a router that a particular destination is either directly connected to the router, or that it can be reached using another router called the next-hop on the way to the final destination. When a router receives an incoming packet, it checks the destination address and attempts to match this address with a routing table entry. Routing metric Different routing protocols use different routing metrics. Routing metrics are used to determine the desirability of a route. For example, the Routing Information Protocol (RIP) uses hop count as its only routing metric. Interior Gateway Routing Protocol (IGRP) uses a combination of bandwidth, load, delay, and reliability metrics to create a composite metric value. Outbound interfaces The interface that the data must be sent out on, in order to reach the final destination.

Routers update tables by different updating protocols.


Periodic updates. Topology changes. Entire Tables. Partial Tables.
Routing Fundamentals and Subnets page 12 of 32

Network Technology II Bridging

Routing algorithms and metrics


Routing protocols use different algorithms to decide which port an incoming packet should be sent to Routing protocols often have one or more of the following design goals: Optimization Optimization describes the capability of the routing algorithm to select the best route. The route will depend on the metrics and metric weightings used in the calculation. For example, one algorithm may use both hop count and delay metrics, but may consider delay metrics as more important in the calculation. Simplicity and low overhead The simpler the algorithm, the more efficiently it will be processed by the CPU and memory in the router. This is important so that the network can scale to large proportions, such as the Internet. Robustness (strong) and stability A routing algorithm should perform correctly when confronted (faced) by unusual or unforeseen circumstances, such as hardware failures, high load conditions, and implementation errors. Flexibility A routing algorithm should quickly adapt to a variety of network changes. These changes include router availability, router memory, changes in bandwidth, and network delay. Rapid convergence Convergence is the process of agreement by all routers on available routes. When a network event causes changes in router availability, updates are needed to re-establish network connectivity. Routing algorithms that converge slowly can cause data to be undeliverable.
Network Technology II Bridging Routing Fundamentals and Subnets page 13 of 32

Routing algorithms and metrics (Contd)


Metrics can be based on a single characteristic of a path, or can be calculated based on several characteristics. Bandwidth The data capacity of a link. Normally, a 10-Mbps Ethernet link is preferable to a 64-kbps leased line. Delay The length of time required to move a packet along each link from source to destination. Delay depends on the bandwidth of intermediate links, the amount of data that can be temporarily stored at each router, network congestion, and physical distance. Load The amount of activity on a network resource such as a router or a link. Reliability Usually a reference to the error rate of each network link. Hop count The number of routers that a packet must travel through before reaching its destination. Each router the data must pass through is equal to one hop. A path that has a hop count of four indicates that data travelling along that path would have to pass through four routers before reaching its final destination. If multiple paths are available to a destination, the path with the least number of hops is preferred. Ticks The delay on a data link using IBM PC clock ticks. One tick is approximately 1/18 second. Cost An arbitrary value, usually based on bandwidth, monetary expense, or other measurement, that is assigned by a network administrator.
Network Technology II Bridging Routing Fundamentals and Subnets page 14 of 32

IGP and EGP


An autonomous system is a network or set of networks under common administrative control, such as the cisco.com domain. An autonomous system consists of routers that present a consistent (the same) view of routing to the external world. Interior Gateway Protocols (IGP) - route data within an autonomous system.
Routing Information Protocol (RIP) and (RIPv2). Interior Gateway Routing Protocol (IGRP). Enhanced Interior Gateway Routing Protocol (EIGRP). Open Shortest Path First (OSPF). Intermediate System-to-Intermediate System protocol (IS-IS).

Exterior Gateway Protocols (EGP).


EGPs route data between autonomous systems. An example of an EGP is Border Gateway Protocol (BGP).

Network Technology II Bridging

Routing Fundamentals and Subnets

page 15 of 32

Link state and distance vector


Distance-Vector Determines distance and direction (vector) to any link in internetwork Routers send all or part of their routing tables to all other routers on periodic basis (routing by rumor ). Routing Information Protocol (RIP) The most common IGP in the Internet, RIP uses hop count as its only routing metric. Interior Gateway Routing Protocol (IGRP) This IGP was developed by Cisco to address issues associated with routing in large, heterogeneous (different kinds of) networks. Enhanced IGRP (EIGRP) This Cisco-proprietary IGP includes many of the features of a link-state routing protocol. Because of this, it has been called a balanced-hybrid protocol, but it is really an advanced distance-vector routing protocol. Link-State Respond quickly to network topology changes. When topology changes, send out Link-State Advertisement (LSAs). Link-state algorithms typically use their databases to create routing table entries that prefer the shortest path. Examples of link-state protocols include Open Shortest Path First (OSPF) and Intermediate System-to-Intermediate System (IS-IS).
Network Technology II Bridging Routing Fundamentals and Subnets page 16 of 32

Routing protocols
RIP
Uses Hop Count as metric Max 15 Hops.
RIPv1 requires all devices in network use same subnet mask classful routing that does not send subnet mask info in updates. RIPv2 allows different subnet masks within network classless routing that sends subnet mask info with updates VLSM.

IGRP
A distance-vector routing protocol developed by Cisco. IGRP can select the fastest available path based on delay, bandwidth, load, and reliability. IGRP higher maximum hop count limit than RIP. IGRP uses only classful routing.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 17 of 32

Routing protocols (Contd)


OSPF is a link-state routing protocol developed by the Internet Engineering Task Force (IETF) in 1988. OSPF was written to address the needs of large, scalable internetworks that RIP could not. Intermediate System-to-Intermediate System (IS-IS) is a link-state routing protocol used for routed protocols other than IP. Integrated IS-IS is an expanded implementation of IS-IS that supports multiple routed protocols including IP. Like IGRP, EIGRP is a proprietary Cisco protocol. EIGRP is an advanced version of IGRP. Specifically, EIGRP provides superior operating efficiency such as fast convergence and low overhead bandwidth. EIGRP is an advanced distance-vector protocol that also uses some link-state protocol functions. Therefore, EIGRP is sometimes categorized as a hybrid routing protocol. Border Gateway Protocol (BGP) is an example of an External Gateway Protocol (EGP). BGP exchanges routing information between autonomous systems while guaranteeing loop-free path selection. BGP is the principal route advertising protocol used by major companies and ISPs on the Internet. BGP4 is the first version of BGP that supports classless interdomain routing (CIDR) and route aggregation. Unlike common Internal Gateway Protocols (IGPs), such as RIP, OSPF, and EIGRP, BGP does not use metrics like hop count, bandwidth, or delay. Instead, BGP makes routing decisions based on network policies, or rules using various BGP path attributes.
Network Technology II Bridging Routing Fundamentals and Subnets page 18 of 32

The Mechanics of Subnetting


Whichever class of address needs to be subnetted, the following rules are the same: Total subnets = 2 to the power of the bits borrowed. Total hosts= 2 to the power of the bits remaining. Usable subnets = 2 to the power of the bits borrowed minus 2. Usable hosts= 2 to the power of the bits remaining minus 2. Subnetworks are smaller divisions of networks. They provide addressing flexibility. Subnet addresses are assigned locally, usually by a network administrator. Subnets reduce a broadcast domain.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 19 of 32

Subnet Addresses
Include Class A, B, or C network portion plus a subnet field and a host field. Bits are borrowed from the host field and are designated as the subnet field.
Network Host

Network

Subnet

Host (at least 2 bits)

Network Technology II Bridging

Routing Fundamentals and Subnets

page 20 of 32

How many bits can I borrow?


You must remain at least 2 bits for the host part.
Size of Host Field Maximum # of borrowed bits

Class A Class B Class C

24 16 8
Routing Fundamentals and Subnets

22 14 6
page 21 of 32

Network Technology II Bridging

Default Subnet Masks

Class A Class B Class C

255.0.0.0 255.255.0.0 255.255.255.0

Network Technology II Bridging

Routing Fundamentals and Subnets

page 22 of 32

Calculating a Subnet
We will subnet the IP address:
223.14.17.0

What class IP address is this?


Class C

Step 1
Determine the default subnet mask Class C default subnet mask: 255.255.255.0

Step 2
Determine the number of subnets needed and hosts on each to determine how many bits to borrow from the host ID. Need: 13 subnets 10 hosts on each subnet

Network Technology II Bridging

Routing Fundamentals and Subnets

page 23 of 32

Calculating a Subnet
Step 3 Figure the actual number of subnets and hosts by borrowing bits from host ID. Lets see how many subnets and hosts we will have by borrowing 4 bits from the host. 223.14.17.0

XXXX

HHHH

16 possible subnets
Network Technology II Bridging

16 possible addresses in host part (see next page)


Routing Fundamentals and Subnets page 24 of 32

Calculating a Subnet
Step 3 continued We get 16 possible subnets and 16 possible hosts for each subnet because: For the 4 bits borrowed each bit can be a 1 or a 0 leaving you with 24 or 16 possible combinations. The same goes for the 4 leftover host bits. Important: There are only 14 available hosts on each subnet. Why? Because address with all '1' is the broadcast address and that with all '0' is the network address. A subnet address with all '0' is a zero subnet and that with all '1' is a broadcast subnet. The zero subnet and the broadcast subnet were reserved in years past but are now usable. The ip subnet-zero command enables the router to use zero subnet. The broadcast subnet can be used without special configuration.
Network Technology II Bridging Routing Fundamentals and Subnets page 25 of 32

Calculating a Subnet
Step 4 Determine the subnet mask.

223.14.17.0

XXXX

HHHH

Where X represents the borrowed bits for subnetting.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 26 of 32

Calculating a Subnet
Step 4 continued Add the place values of X together to get the last octet decimal value of the subnet mask.
last octet of the subnet mask= 27 26 25 24 23 22 21 20

1 1 1 1 0 0 0 0 128 + 64 + 32 + 16 = 240

The subnet mask is: 255.255.255.240 The subnet mask is used to reveal the subnet and host address fields in IP addresses.
Network Technology II Bridging Routing Fundamentals and Subnets page 27 of 32

Calculating a Subnet
Step 5 Determine the ranges of host addresses for each subnet.
Subnet # 1 2 3 4 5 6 7 8 Subnet Bits 0000 0001 0010 0011 0100 0101 0110 0111 Host Bits 0000-1111 0000-1111 0000-1111 0000-1111 0000-1111 0000-1111 0000-1111 0000-1111 In Decimal .0 -.15 .16 - .31 .32 - .47 .48 - .63 .64 - .79 .80 - .95 .96 - .111 .112 - .127

Network Technology II Bridging

Routing Fundamentals and Subnets

page 28 of 32

Calculating a Subnet
Step 5 continued ...
Subnet # 9 10 11 12 13 14 15 16 Subnet Bits 1000 1001 1010 1011 1100 1101 1110 1111 Host Bits 0000-1111 0000-1111 0000-1111 0000-1111 0000-1111 0000-1111 0000-1111 0000-1111 In Decimal .128 -.143 .144 - .159 .160 - .175 .176 - .191 .192 - .207 .208 - .223 .224 - .239 .240 - .255

Network Technology II Bridging

Routing Fundamentals and Subnets

page 29 of 32

Calculating a Subnet
Step 5 continued.
There are 16 possible subnets. There are 16 possible hosts on each subnet. That equals 256 possible hosts. What are our available subnets? Ans: 16 (including the zero subnet and the broadcast subnet) What are our available hosts on each subnet? Why????? Ans: 14 available hosts on each subnet, because the two host addresses with all '0' and all '1' are reserved, i.e. number of hosts = 2n-1, where n = number of host bits.
Network Technology II Bridging Routing Fundamentals and Subnets page 30 of 32

Figuring Subnet Network Addresses


Step #1: Change the IP host address to binary. Step #2: Change the subnet mask to binary. Step #3: Use the boolean operator AND to combine the two. Step #4:Convert the network binary address to dotted decimal.

Network Technology II Bridging

Routing Fundamentals and Subnets

page 31 of 32

Figuring Subnet Network Addresses


IP Host Subnet Mask 172.16.2.120 255.255.255.0

10101100.00010000.00000010.01111000 AND 11111111.11111111.11111111.00000000 10101100.00010000.00000010.00000000


172.16.2.0 This is the subnet network address. It is the lowest numbered address on the subnet network. It can help determine path.
Network Technology II Bridging Routing Fundamentals and Subnets page 32 of 32

Das könnte Ihnen auch gefallen