Professional Documents
Culture Documents
IP(Internet Protocol)
• IP focuses on the job of routing data, in the form of IP packets, from the source
host to the destination host.
• IP does not concern itself with the physical transmission of data, instead relying on
the lower TCP/IP layers to do the physical transmission of the data.
• Instead, IP concerns itself with the logical details, rather than physical details, of
delivering data.
• In particular, the network layer specifies how packets travel end to end over a
TCP/IP network, even when the packet crosses many different types of LAN and
WAN links.
Network Layer Routing (Forwarding) Logic
• Routers and end-user computers (called hosts in a TCP/IP network) work together
to perform IP routing.
• The host operating system (OS) has TCP/IP software, including the software that
implements the network layer.
• Hosts use that software to choose where to send IP packets, often to a nearby
router. Those routers make choices of where to send the IP packet next.
Host Forwarding Logic: Send the Packet to the
Default Router
• In prior diagram, PC1 does some basic analysis, and then chooses to
send the IP packet to the router so that the router will forward the
packet.
• PC1 analyzes the destination address and realizes that PC2’s address
(168.1.1.1) is not on the same LAN as PC1.
• So PC1’s logic tells it to send the packet to a device whose job it is to
know where to route data: a nearby router, on the same LAN, called
PC1’s default router.
• To send the IP packet to the default router, the sender sends a data-
link frame across the medium to the nearby router; this frame
includes the IPpacket in the data portion of the frame.
• That frame uses data link layer (Layer 2) addressing in the data-link
header to ensure that the nearby router receives the frame.
• The final router in the path, R3, uses almost the same logic as R1 and
R2, but with one minor difference. R3 needs to forward the packet
directly to PC2, not to some other router.
How Network Layer Routing Uses LANs and WANs
• For routing logic to work on both hosts and routers, each needs to
know something about the TCP/IP internetwork.
• Hosts need to know the IP address of their default router so that
hosts can send packets to remote destinations.
• Routers, however, need to know routes so that routers know how to
forward packets to each and every IP network and IP subnet.
• Although a network engineer could configure (type) all the required
routes, on every router, most network engineers instead simply
enable a routing protocol on all routers.
• If you enable the same routing protocol on all the routers in a TCP/IP
internetwork, with the correct settings, the routers will send routing
protocol messages to each other.
• As a result, all the routers will learn routes for all the IP networks and
subnets in the TCP/IP internetwork.
Examples of Routing Protocols
• OSPF
• RIP
• BGP
IPv4 Addressing
• Rules for IP Addresses
• If a device wants to communicate using TCP/IP, it needs an IP
address.
• When the device has an IP address and the appropriate software
and hardware, it can send and receive IP packets.
• Any device that has at least one interface with an IP address can
send and receive IP packets and is called an IP host.
• IP addresses consist of a 32-bit number, usually written in dotted-
decimal notation (DDN).
• For example, 168.1.1.1 is an IP address written in dotted-decimal
form; the actual binary version is
10101000.00000001.00000001.00000001
• Each DDN has four decimal octets, separated by periods
• Because each octet represents an 8-bit binary number, the range of
decimal numbers in each octet is between 0 and 255, inclusive.
• For example, the IP address of 168.1.1.1 has a first octet of 168, the
second octet of 1, and so on.
• Each device can have multiple IP addreses
• Ex: Laptop with wired NIC and wireless NICs and routers have
different ports have separate IP addresses
Rules for Grouping IP Addresses
• IP networks/subnet has consecutive addresses.
• The addresses in a single IP network have the same numeric value in
the first part of all addresses in the network.
Two important facts about how IPv4 groups IP addresses:
• All IP addresses in the same group must not be separated from each
other by a router.
• IP addresses separated from each other by a router must be in
different groups. (go back to fig)
Class A, B, and C IP Networks
• The IPv4 address space includes all possible combinations of numbers
for a 32-bit IPv4 address.
• Literally 232 different values exist with a 32-bit number, for more than
4 billion different numbers.
• With DDN values, these numbers include all combinations of the
values 0 through 255 in all four octets: 0.0.0.0, 0.0.0.1, 0.0.0.2, and all
the way up to 255.255.255.255.
• IP standards first subdivide the entire address space into classes, as
identified by the value of the first octet.
1. Class A gets roughly half of the IPv4 address space, with all DDN
numbers that begin with first octet 1–126.
2. 127.0.0.0-127.0.255.255 is assigned as Localhost address(loopback)
3. Class B gets one-fourth of the address space, with all DDN numbers
that begin with first octet 128–191 inclusive.
4. Class C gets one-eighth of the address space, with all numbers that
begin with first octet 192–223.
IPV4 address space
The Actual Class A, B, and C IP Networks
Actual IP
Bit patterns for Class A,B,C
Sample Class A Address
Sample Class B Address
Sample Class C Address
Default Subnet mask
• Default subnet mask address says which part of ip address is host part and
network part.
• Class A-255.0.0.0
• Class B-255.255.0.0
• Class C-255.255.255.0