Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the...

40
By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II ١ Lecture (06) Network Access layer fundamentals (4) LAN, & WAN Internetwork Layer I Agenda OSI Layer 2 of WANs Internetwork layer Introduction Network Layer Interaction with the Data Link Layer Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Transcript of Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the...

Page 1: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

By:

Dr. Ahmed ElShafee

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II١

Lecture (06)Network Access layer fundamentals (4)LAN, & WAN

Internetwork Layer I

Agenda

• OSI Layer 2 of WANs

• Internetwork layer

• Introduction

• Network Layer Interaction with the Data Link Layer

• Network Layer (Layer 3) Addressing

٢ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 2: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs

• WAN protocols used on point‐to‐point serial links provide the basic function of data delivery across that one link. 

• The two most popular data‐link protocols used on point‐to‐point links are 

– High‐Level Data Link Control (HDLC) and 

– Point‐to‐Point Protocol (PPP).

٣ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (2)

1. HDLC

HDLC performs OSI Layer 2 functions,

• Arbitration—Determines when it is appropriate to use the physical medium

• Addressing—Ensures that the correct recipient(s) receives and processes the data that is sent

• Error detection—Determines whether the data made the trip across the physical medium successfully

• Identifying the encapsulated data—Determines the type of header that follows the datalink header

٤ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 3: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (3)

1. Arbitration

• HDLC is very simple as compared with Ethernet

• Ethernet uses CSMA/CD algorithm arbitrates

• point‐to‐point serial link, each router can send over the four‐wire (two‐pair) circuit at any time, so there is no need for any kind of a arbitration.

٥ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (4)

• HDLC defines framing that includes an 

1. address field, 

2. frame check sequence (FCS) field, 

3. And a protocol type field. 

• These three fields in the HDLC frame help provide the other three functions of the data link layer.

٦ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 4: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (5)

2. Addressing

• HDLC defines a 1‐byte address field, although on point‐to‐point links, it is not really needed.

• In the past HDLC was used for a multidrop circuit. 

• With a multidrop circuit, one central site device could send and receive frames with multiple remote sites. 

• HDLC defined the address field to identify the different remote sites on a multidrop link.

• Now HDLC used for point to point links so address is not used, routers insert decimal 3 into address field.

٧ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (6)

3. Error Detection

• HDLC performs error detection just like Ethernet—it uses an FCS field in the HDLC trailer. And just like Ethernet, if a received frame has errors in it, the frame is discarded, with no error recovery performed by HDLC.

4. Identifying the encapsulated data

• HDLC performs the function of identifying the encapsulated data just like Ethernet as well.

• When a router receives an HDLC frame, it wants to know what type of packet is held inside the frame.

٨ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 5: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (7)

2. Point‐to‐Point Protocol

Comparing the basics, PPP behaves exactly like HDLC

1. There is an address field, but the addressing does not matter. 

٩ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

2. PPP does discard errored frames that do not pass the FCS check. 

3. And PPP uses a 2‐byte Protocol Type field—although PPP’s Protocol Type field is defined by the protocol

Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II١٠

Page 6: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (8)

• PPP‐unique features fall into two main categories:

1. Those needed regardless of the Layer 3 protocol sent across the link

2. Those specific to each Layer 3 protocol 

• Each link that uses PPP has one LCP (link control protocol) per link and one CP (control protocol) for each Layer 3 protocol defined on the link.

١١ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (9)

Link Control Protocol (LCP), 

• focuses on the features that apply regardless of the Layer 3 protocol used. 

• LCP performs most of its work when the line comes up, so it has a lot more work to do with dialed links, which come up and down a lot, versus leased lines, which hopefully seldom fail.

١٢ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 7: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (10)

١٣ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (11)

IP Control Protocol (IPCP) (type of LC)

• provides for IP address assignment over a PPP link. 

• When a user dials a new connection to an ISP using a modem, PPP typically is used, with IPCP assigning an IP address to the remote PC.

• If a router is configured for IPX, AppleTalk, and IP on a PPP serial link, the router configured for PPP encapsulation automatically tries to bring up the appropriate controlprotocols for each Layer 3 protocol.

١٤ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 8: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II١٥

OSI Layer 2 of WANs (12)

3. Other Point‐to‐Point WAN Data‐Link Protocols

• WAN data‐link protocols can be compared relative to two main attributes. 

1. First, some protocols do support multiprotocol traffic by virtue of having a defined protocol type field.

2. Also, some protocols actually perform error recovery—so when the receiving end notices that the received frame did not pass the FCS check, it causes the frame to be resent.

١٦ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 9: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (13)

١٧ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (14)

• Synchronization

• Both of HDLC and PPP are synchronous.

• Synchronous means sending and receiving ends uses the same clock.

• it is expensive to build devices that truly can operate at exactly the same speed.

• So, the devices operate at close to the same speed and listen to the speed of the other device on the other side of the link. 

• One side makes small adjustments in its rate to match the other side.

١٨ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 10: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

١٩ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (16)

Frame Relay

• Frame Relay networks are multi‐access networks, which means that more than two devices can attach to the network, similar to LANs. 

• To support more than two devices, the protocols must be a little more detailed.

٢٠ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 11: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (17)

• Frame Relay uses the same Layer 1 features as a point‐to‐point leased line. 

• For a Frame Relay services, a leased line is installed between each router and a nearby Frame Relay switch; these links are called access links.

• The access links run the same speeds and use the same signaling standards as do point‐to‐point leased lines.

٢١ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (18)

• Each frame header holds an address field called a data‐link connection identifier (DLCI).

• The WAN switch forwards the frame, based on the DLCI, through the provider’s network until it gets to the router on the other side of the network.

• so that it’s called packet switching service, and that’s the main difference between point2point and frame relay. 

٢٢ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 12: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II٢٣

OSI Layer 2 of WANs (19)

• Frame Relay protocols resemble OSI Layer 2 protocols; the term usually used for the bits sent by a Layer 2 device is frame

• the Frame Relay switches are called DCE, and the customer equipment—routers, in this case—are called DTE

• DCE refers to the device providing the service, and the term DTE refers to the device needing the frame‐switching service.

٢٤ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 13: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (20)

• At the same time, the CSU/DSU provides clocking to the router, so from a Layer 1 perspective, the CSU/DSU is still the DCE and the router is still the DTE. 

• It’s just two different uses of the same terms.

٢٥ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (21)

• The logical path between each pair of routers is called a Frame Relay permanent virtual circuits (PVCs). 

• When R1 needs to forward a packet to R2, it encapsulates the Layer 3 packet into a Frame Relay header and trailer and then sends the frame. 

• R1 uses a Frame Relay address called a DLCI in the Frame Relay header. 

٢٦ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 14: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• Permanent virtual circuit (PVC) is the main feature of frame relay over p2p

• Figure shows 

connecting 3 sites 

using 3 leased lines 

and 3 frame relay 

switches

OSI Layer 2 of WANs (22)

٢٧ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

OSI Layer 2 of WANs (23)

• In the example, both VCs terminating at R1 use the same access link. 

• So, with large networks with many WAN sites that need to connect to a central location, only one physical access link is required from the main site router to the Frame Relay network. 

• If point‐to‐point links were used, a physical circuit, a separate CSU/DSU, and a separate physical interface on the router would be required for each point‐to‐point link. 

• So, Frame Relay enables you to expand the WAN but add less hardware to do so.

٢٨ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Page 15: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

OSI Layer 2 of WANs (24)

• Frame Relay is designed with the concept of a committed information rate (CIR). 

• Each VC has a CIR, which is a guarantee by the provider that a particular VC gets at least that much bandwidth. 

• You can think of CIR of a VC like the bandwidth or clock rate of a point‐to‐point circuit, except that it’s the minimum value—you can actually send more, in most cases.

٢٩ Dr. Ahmed ElShafee, ACU Fall2016, Computer Networks II

Internetwork layer

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٠

Page 16: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Introduction

Typical features of OSI layer 3

OSI layer 3 or network layer, or internet layer in case of TCP/IP protocol is a protocol that defines routing and addressing

Such as

• Connectionless Network Services (CLNS),

• Internet Protocol (IP), 

• Novell Internetwork Packet Exchange (IPX),

• or AppleTalk Dynamic Data Routing (DDR)

network layer protocols have many similarities.

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣١

Introduction (2)

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٢

Routing (Path Selection)

• Routing focuses on the end‐to‐end logic of forwarding data. 

• Figure shows a simple example of how routing works. 

• The logic seen in the figure is relatively simple. 

• For PC1 to send data to PC2, it must send something to R1, when sends it to R2, then on to R3, and finally to PC2.

Page 17: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Introduction (3)

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٣

PC1’s Logic: Sending Data to a Nearby Router

• In this example, PC1 has some data to send data to PC2. 

• Because PC2 is not on the same Ethernet as PC1, PC1 needs to send the packet to a router that is attached to the same Ethernet as PC1. 

• The sender sends a data‐link frame across the medium to the nearby router; this frame includes the packet in the data portion of the frame. 

Introduction (4)

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٤

• That frame uses data link layer (Layer 2) addressing in the data‐link header to ensure that the nearby router receives the frame.

• The main point here is that the originator of the data does not know much about the network—just how to get the data to some nearby router.

• PC1 needs to know only how to get the packet to R1.

Page 18: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Introduction (5)

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٥

R1 and R2’s Logic: Routing Data Across the Network

• R1 and R2 both use the same general process to route the packet

• The routing table contains one entry per group of addresses

• The router compares the destination network layer address in the packet to the entries in the routing table

• The matching entry in the routing table tells this router where to forward the packet next.

Introduction (6)

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٦

• Likewise, in Figure everyone in this the network whose IP address starts with 168.1 is on the Token Ring on which PC2 resides, 

• So the routers can just have one routing table entry that means “all addresses that start with 168.1.”

• Eventually, the packet is delivered to the router connected to the network or subnet of the destination host (R3),

Page 19: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Introduction (7)

R3’s Logic: Delivering Data to the End Destination

• R3 needs to forward the packet directly to PC2, not to some other router.

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٧

Network Layer Interaction with the Data Link Layer

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٨

• four different types of data links were used to deliver the data

• When the network layer protocol is processing the packet, it decides to send the packet out the appropriate data link layer.

• the data link layer adds the appropriate header and trailer to the packet, creating a frame, before sending the frames over each physical network.

Page 20: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• The network layer processes deliver the packet end‐to‐end, using successive data‐link headers and trailers just to get the packet to the next router or host in the path.

• the PCs and routers must have some way to decide what data‐link addresses to use

• Address Resolution Protocol (ARP) is used to dynamically learn the data‐link address of an IP host connected to a LAN.

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٣٩

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٠

• One key feature of network layer addresses is that they were designed to allow logical grouping of addresses (routing process)

• In TCP/IP, this group is called a network or a subnet. 

• In IPX, it is called a network. 

• In AppleTalk, the grouping is called a cable range.

• Just like postal street addresses, network layer addresses are grouped based on physical location in a network

Page 21: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤١

• In each of these network layer protocols, all devices on opposite sides of a router must be in a different Layer 3 group.

• The routing tables for each network layer protocol can have one entry for the group,

• Imagine an Ethernet with 100 TCP/IP hosts. A router needing to forward packets to any of those hosts needs only one entry in its IP routing table. 

• This basic fact is one of the key reasons that routers can scale to allow tens and hundreds of thousands of devices

• The same logic of people in the same ZIP code live near to each other.

• If that local town wants to add streets, the rest of the post offices in the country already are prepared because they just forward letters based on the ZIP code, which they already know. 

• The only postal employees who care about the new streets are the people in the local post office.

• Also, you can have duplicate local street addresses, as long as they are in different ZIP codes, and it all still works. Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٢

Page 22: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٣

Example Layer 3 Address Structures

• Each Layer 3 address structure contains at least two parts. One (or more) part at the beginning of the address works like the ZIP code and essentially identifies the grouping.

• All addresses with the same value in the first part are in the same group—for example, the same IP subnet or IPX network or AppleTalk cable range.

• The last part of the address acts as a local address, uniquely identifying that device in that particular group

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٤

Routing Protocols

• In most cases, routing table entries are built dynamically by use of a routing protocol. 

• Routing protocols learn about all the locations of the network layer “groups” in a network.

• Routing protocols define message formats and procedures to build the routing table. 

• The end goal of each routing protocol is to fill the routing table with all known destination groups and with the best route to reach each group.

Page 23: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• routers uses the Routing Information Protocol (RIP) to learn the routes

• IP protocol called routed protocol, which is responsible of packet forwarded, or routed, through a network.

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٥

IP Addressing Definitions

• If a device wants to communicate using TCP/IP, it needs an IP address. 

• Any device that can send and receive IP packets is called an IP host.

• IP addresses consist of a 32‐bit number, usually written in dotted‐decimal notation

• For instance, 168.1.1.1 is an IP address written in dotted‐decimal form

• Each of the decimal numbers in an IP address is called an octet which is a byte.

• The range of decimal numbers in each octet is between 0 and 255, inclusive.

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٦

Page 24: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• computer’s network card has an IP address. 

• If you put two Ethernet cards in a PC to forward IP packets through both cards, they both would need unique IP addresses.

• Similarly, routers, which typically have many network interfaces that forward IP packets, have an IP address for each interface.

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٧

How IP Addresses Are Grouped Together

• For example, all IP addresses that begin with 8 are on the Token Ring on the left. 

• Likewise, all IP addresses that begin with 130.4 are on the right. 

• Along the same lines, 199.1.1 is the prefix on the serial link. 

• By following this convention, the routers build a routing table with three entries, one for each prefix, or network number.

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٨

Page 25: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

So, the general ideas about how IP address groupings can be summarized are as follows:

• All IP addresses in the same group must not be separated by a router.

• IP addresses separated by a router must be in different groups.

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٤٩

Classifying IP Addresses

• In IP addressing scheme, some arbitrary number of bits for it is assigned an  for network ID, The remaining bits then be used for the host ID.

• suppose that half of the address (16 bits) would be used for the network, the remaining 16 bits used for the host ID. result of that scheme would be 65,536 networks, each of those networks could have 65,536 hosts.

• Suppose that a network of 1,000 computers joins the Internet and is assigned one of these hypothetical network IDs, that network then wast 64,000 IP addresses for hosts.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٠

Page 26: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• Solution, is IP address classes

• The IP protocol defines five different address classes: A, B, C, D, and E.

• of the first three classes, A–C, uses a different size for the network ID and host ID portion of the address.

• Class D is for a special type of address called a multicast address. 

• Class E is an experimental address class that isn’t used.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥١

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٢

Page 27: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• The first four bits of the IP address are used to determine into which class a particular address fits, as follows:

• If the first bit is zero, the address is a Class A address “0xxx”

• If the first bit is one and if the second bit is zero, the address is a Class B address. “10xx”

• If the first two bits are both one and if the third bit is zero, the address is a Class C address. “110x”

• If the first three bits are all one and if the fourth bit is zero, the address is a Class D address “1100”

• If the first four bits are all one, the address is a Class E address. “1111”

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٣

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٤

Page 28: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• Class A addresses

• Class A addresses are designed for very large networks, as only eight bits are allocated to the network, first of these bits is used to indicate that the address is a Class A, only 126 Class A networks can exist in the entire Internet.

• The last 3 octets are used for hosts, so each network can accommodate more than 16 million hosts.

• Only about 40 Class A addresses are actually assigned to companies or organizations, The rest are either reserved by Internet Assigned Numbers Authority (IANA)

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٥

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٦

Page 29: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٧

• Class B addresses

• the first two octets of the IP address are used as the network ID, and the second two octets are used as the host ID.

• in order to indicate that the address is Class B the first two bits of the first octet are required to be 10, As a result, a total of 16,384 Class B networks can exist.

• Each Class B network can accommodate more than 65,000 hosts.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٨

Page 30: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• The problem with Class B networks is that even though they are much smaller than Class A networks, they still allocate far too many host IDs.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٥٩

• Note:

• Class A addresses end with126.x.y.z, and Class B addresses begin with 128.x.y.z. 

• What happened to 127.x.y.z? This special range of addresses is reserved for loopback testing, so these addresses aren’t assigned to public networks.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٠

Page 31: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Class C addresses

• the first three octets are used for the network ID, and the fourth octet is used for the host ID.

• with 24 network ID bits, Class C addresses allow for more than 2 million networks, each Class C network can accommodate only 254 hosts

• The problem with Class C networks is that they’re too small.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦١

Subnetting

• A subnet is a network that falls within a Class A, B, or C network. 

• Subnets are created by using one or more of the Class A, B, or C host bits to extend the network ID. 

• Thus, instead of the standard 8‐, 16‐, or 24‐bit network ID, subnets can have network IDs of any length.

• Following Figure shows an example of a network before and after subnetting has been applied. 

• In the unsubnetted network, the network has been assigned the Class B address 192.168.0.0. 

• All the devices on this network must share the same broadcast domain.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٢

Page 32: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٣

• In the second network, the first four bits of the host ID are used to divide the network into two small networks, identified as subnets 16 and 32. 

• To the outside world (that is, on the other side of the router), these two networks still appear to be a single network identified as 192.168.0.0. 

• For example, the outside world considers the device at 192.168.1.2 to belong to the 192.168.0.0 network. 

• As a result, a packet sent to this device will be delivered to the router at 192.168.0.0. 

• The router then considers the subnet portion of the host ID to decide whether to route the packet to subnet 1 or subnet 2.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٤

Page 33: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Subnet masks

• For subnetting to work, the router must be told which portion of the host ID should be used for the subnet network ID.

• That is accomplished by using another 32‐bit number, known as a subnet mask.

• Those IP address bits that represent the network ID are represented by a 1 in the mask, and those bits that represent the host ID appear as a 0 in the mask.

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٥

• Subnet  mask here

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٦

11111111 11111111 00000000 00000000

255 255 0 0

Page 34: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٧

Router 11111111 11111111 11111100 00000000

255 255 252 0

PCs 11111111 11111111 11111100 00000000

255 255 252 0

• Example

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٨

Router IP 192 168 0 1

11000000 10101000 00000000 00000001

Subnet Mask 11111111 11111111 00000000 00000000

255 255 0 0

Network IP 192 168 0 0

PC1 IP 192 168 0 2

11000000 10101000 00000000 00000010

Subnet Mask 11111111 11111111 00000000 00000000

255 255 0 0

Network IP 192 168 0 0

Page 35: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

• Example

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٦٩

Router IP 192 168 0 1

11000000 10101000 00000000 00000001

Subnet Mask 11111111 11111111 11111100 00000000

255 255 252 0

Network IP 192 168 0 0

PC1 IP 192 168 1 1

11000000 10101000 00000001 00000001

Subnet Mask 11111111 11111111 11111100 00000000

255 255 252 0

Network IP 192 168 0 0

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧٠

PC2 IP 192 168 2 1

11000000 10101000 00000010 00000001

Subnet Mask 11111111 11111111 11111100 00000000

255 255 252 0

Network IP 192 168 0 0

Page 36: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧١

Router IP 192 168 0 1

11000000 10101000 00000000 00000001

Subnet Mask 11111111 11111111 00000000 00000000

255 255 0 0

Network IP 192 168 0 0

PC1 in sub network 1

IP 192 168 16 1

11000000 10101000 00010000 00000001

Subnet Mask 11111111 11111111 00000000 00000000

255 255 0 0

Network IP 192 168 0 0

Example 01

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧٢

PC2 PC1 in sub network 2

IP 192 168 32 1

11000000 10101000 00100000 00000001

Subnet Mask 11111111 11111111 00000000 00000000

255 255 0 0

Network IP 192 168 0 0

Page 37: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧٣

Router IP 192 168 0 1

11000000 10101000 00000000 00000001

Subnet Mask 11111111 11111111 11111111 00000000

255 255 255 0

Network IP 192 168 0 0

PC1 IP 192 168 16 1

11000000 10101000 00010000 00000001

Subnet Mask 11111111 11111111 11111111 00000000

255 255 255 0

Network IP 192 168 16 0

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧٤

PC2 IP 192 168 32 1

11000000 10101000 00100000 00000001

Subnet Mask 11111111 11111111 11111111 00000000

255 255 255 0

Network IP 192 168 32 0

Page 38: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧٥

Router IP 192 168 0 1

11000000 10101000 00000000 00000001

Subnet Mask 11111111 11111111 11000000 00000000

255 255 192 0

Network IP 192 168 0 0

PC1 IP 192 168 16 1

11000000 10101000 00010000 00000001

Subnet Mask 11111111 11111111 11000000 00000000

255 255 192 0

Network IP 192 168 0 0

Subnetting

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧٦

PC2 IP 192 168 32 1

11000000 10101000 00100000 00000001

Subnet Mask 11111111 11111111 11000000 00000000

255 255 192 0

Network IP 192 168 0 0

Page 39: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧٧

Router IP 192 168 128 1

11000000 10101000 10000000 00000001

Subnet Mask 11111111 11111111 11000000 00000000

255 255 192 0

Network IP 192 168 128 0

PC1 on sub network 1

IP 192 168 144 1

11000000 10101000 10010000 00000001

Subnet Mask 11111111 11111111 11000000 00000000

255 255 192 0

Network IP 192 168 128 0

Example 02

Dr. Ahmed ElShafee, ACU Fall 2013, Network I٧٨

PC2 on subnetwork 2

IP 192 168 160 1

11000000 10101000 10100000 00000001

Subnet Mask 11111111 11111111 11000000 00000000

255 255 192 0

Network IP 192 168 128 0

Page 40: Lecture (06) Network layer fundamentals LAN, WAN Layer I · •Network Layer Interaction with the Data Link Layer •Network Layer (Layer 3) Addressing ٢ Dr. Ahmed ElShafee, ACU

Thanks,..

See you next week (ISA),…

Dr. Ahmed ElShafee, ACU : Fall 2016, Networks II٧٩