Sie sind auf Seite 1von 60

Internet

Internet comprises of large number of different access networks which are interconnected together by means of global internetwork. Global internetwork consists of an interconnected set of national, international ,networks all of which are interconnected together using devices called routers. Internet operates in packet-switched mode.

Internet Protocol The IP in UDP/IP and TCP/IP


IP is the network layer packet delivery service (host-to-host). translation between different data-link protocols. IP is connectionless in the end-to-end delivery Data delivered in datagrams (packets / frames), each with a header Combines collection of physical networks into single, virtual network

Transport protocols use this connectionless service to provide connectionless data delivery (UDP) and connection-oriented data delivery (TCP)

Netprog 2002 TCP/IP

IP Datagrams
IP provides connectionless, unreliable delivery of IP datagrams. Connectionless: each datagram is independent of all others. Unreliable: there is no guarantee that datagrams are delivered correctly or at all.
Netprog 2002 TCP/IP

9.1:Introduction

Internet
Various Access networks have different operational parameters like bit rate, frame format, max frame size used. The routing and forwarding operations performed at gateway are done at the network layer

Packets serve same purpose in internet as frames on LAN Routers (or gateways) forward packets between physical networks Packets have a uniform, hardware-independent format
Includes header and data Why are these virtual? Because we would like a packet to be capable of crossing multiple networks, where networks could use different types of technologies (e.g. Token Ring, Ethernet)

Virtual Packets

The virtual packet is implemented by encapsulating it in hardware frames for delivery across each physical network
Ensures universal format across heterogenous networks

IP address
IP in each host has a unique Internet wide address assigned to it ,it is known as IP address It has 2 parts: Netid- allocated by Internet Network Information Center(InterNIC) Hostid

Protocols Used
ARP(Address Resolution Protocol)- Obtaining of Physical address from logical address RARP(Reverse Address Resolution Protocol) OSPF(Open Shortest Path First) ICMP(Internet Control Message Protocol) IGMP(Internet Group Management Protocol)

The IP Datagram Formally, the unit of IP data delivery is called a


Header area usually fixed (20 octets) but can have options Data area can contain between 1 octet and 65,535 octets (216- 1) Usually, data area much larger than header (why?)

datagram Includes header area and data area Datagrams can have different sizes

Forwarding Datagrams
The header contains all the information needed to deliver a datagram to a destination computer
Destination address Source address Identifier Other delivery information

Routers examine the header of each datagram and forwards the datagram along a path to the destination
Use routing table to compute next hop Update routing tables using algorithms
Link state, distance vector, manually

9.2:IP datagrams
IPv4 =>IP version 4

Source address Parameters Destination address Upper Layer Protocol


Recipient e.g. TCP

(1)

Type of Service
Specify treatment of data unit during transmission through networks Ignored by many routers

Identifier
Uniquely identifies PDU for a particular sender/receiver Needed for re-assembly and error reporting Send only; i.e. in sending a data packet, not used for Deliver or ACK mode Fragmentation dropped in IP6

Flags (3 bits)

First: Is this data fragmented? Second: Are we allowed to fragment the data?
If not, may not be possible to deliver

Parameters (2)

Third: not used

Time to live
Prevent datagram from traveling forever by decrementing each hop

Header length
In groups of 4 bytes

Total length
In bytes, includes header and data

Option data User data

Type of Service
Might be useful to differentiate traffic, e.g. ICMP vs. data, or real-time data vs. non-real time Precedence
8 levels

Reliability
Normal or high

Delay
Normal or low

Throughput
Normal or high

Type of Service
Might be useful to differentiate traffic, e.g. ICMP vs. data, or real-time data vs. non-real time Precedence
8 levels

Reliability
Normal or high

Delay
Normal or low

Throughput
Normal or high

These are often ignored by routers

Meant to be used rarely. Way to extend the IP protocol with a variable number of options. Dropped in IPv6.
Security Source routing Loose Source routing Route recording Stream identification Time stamping

Options

Since this is optional, it means headers can be of variable length


This is why we need the Header Length field If an IP datagram has no options, H-LEN = 5 Header with 96 bits of options has H-LEN = 8

Datagram Lifetime Datagrams could loop indefinitely


Consumes resources Transport protocol may need upper bound on datagram life

Datagram marked with lifetime


Time To Live field in IP Once lifetime expires, datagram discarded (not forwarded) Hop count
Decrement time to live on passing through a each router

Time count
Need to know how long since last router

Data Field
Carries user data from next layer up
Likely UDP/TCP packet

Integer multiple of 8 bits long (octet) Max length of datagram (header plus data) 65,535 octets

IP address
An IP address is an address used to uniquely identify a device on an IP network. The address is made up of 32 binary bits which can be divisible into a network portion and host portion with the help of a subnet mask. The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and separated by a period (dot). For this reason, an IP address is said to be expressed in dotted decimal format (for example, 172.16.81.100). The value in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary.

9.4:IP address
Address class

Class Leftmost bits Start address

Finish address

A
B C D E

0xxx
10xx 110x 1110 1111

0.0.0.0
128.0.0.0 192.0.0.0 224.0.0.0 240.0.0.0

126.255.255.255
191.255.255.255 223.255.255.255 239.255.255.255 255.255.255.255

There are 5 different address classes. You can determine which class any IP address is in by examining the first 4 bits of the IP address. Class A addresses begin with 0xxx, or 1 to 126 decimal. Class B addresses begin with 10xx, or 128 to 191 decimal. Class C addresses begin with 110x, or 192 to 223 decimal. Class D addresses begin with 1110, or 224 to 239 decimal. Class E addresses begin with 1111, or 240 to 254 decimal.
Addresses beginning with 01111111, or 127 decimal, are reserved for loopback and for internal testing on a local machine. [You can test this: you should always be able to ping 127.0.0.1, which points to yourself] Class D addresses are reserved for multicasting. Class E addresses are reserved for future use. They should not be used for host addresses.

An address with a hostid of all 0s- Default Network - The IP address of 0.0.0.0 is used for the default network An address with a netid of all 0s implies the same network as the source network/netid An address of all 1s means broadcast the packet over the source network An address with a hostid of all 1s means broadcast the packet over the destination network in the netid part A class A address with a netid of all 1s is used for test purposes within the protocol stack of the source host.It is loopback address

RESERVED IP ADDRESSES
Network address of all ones Interpreted to mean 'all networks'

Network 127

Reserved for loop back tests. Designates the local node and allows that node to send a test packet to itself without generating network traffic.
Address Network address of all zeros Function Interpreted to mean 'this network'

Node address of all zeros

Interpreted to mean 'this node'

Node address of all ones

Interpreted to mean 'all nodes' on the specified network, for example, 128.2.255.255 means 'all nodes' on network 128.2 (Class B address)

entire IP address set to all ones

Broadcast to all nodes on the current network: (same as 255.255.255.255) sometimes called an 'all ones broadcast'

Network Mask
A network mask helps you know which portion of the address identifies the network and which portion of the address identifies the node. Class A, B, and C networks have default masks, also known as natural masks, as shown here: Class A: 255.0.0.0 Class B: 255.255.0.0 Class C: 255.255.255.0

Network Mask
An IP address on a Class A network that has not been subnetted would have an address/mask pair similar to: 8.20.15.1 /255.0.0.0. To see how the mask helps you identify the network and node parts of the address, convert the address and mask to binary numbers. 8.20.15.1 = 00001000.00010100.00001111.00000001 255.0.0.0 = 11111111.00000000.00000000.00000000 Once you have the address and the mask represented in binary, then identifying the network and host ID is easier. Any address bits which have corresponding mask bits set to 1 represent the network ID. Any address bits that have corresponding mask bits set to 0 represent the node ID.

Default subnet masks: Class A 255.0.0.0 11111111.00000000.00000000.00000000 Class B 255.255.0.0 11111111.11111111.00000000.00000000 Class C 255.255.255.0 11111111.11111111.11111111.00000000

Understanding Subnetting
Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network. If you do not subnet, you are only able to use one network from your Class A, B, or C network, which is unrealistic. Each data link on a network must have a unique network ID, with every node on that link being a member of the same network. If you break a major network (Class A, B, or C) into smaller subnetworks, it allows you to create a network of interconnecting subnetworks. Each data link on this network would then have a unique network/subnetwork ID. Any device, or gateway, connecting n networks/subnetworks has n distinct IP addresses,

one for each network / subnetwork that it interconnects.

Subnetting
In order to subnet a network, extend the natural mask using some of the bits from the host ID portion of the address to create a subnetwork ID. For example, given a Class C network of 204.17.5.0 which has a natural mask of 255.255.255.0, you can create subnets in this manner: 204.17.5.0 - 11001100.00010001.00000101.00000000 255.255.255.224 11111111.11111111.11111111.11100000 By extending the mask to be 255.255.255.224, you have taken three bits (indicated by "sub") from the original host portion of the address and used them to make subnets. With these three bits, it is possible to create eight subnets. With the remaining five host ID bits, each subnet can have up to 32 host addresses, 30 of which can actually be assigned to a device since host ids of all zeros or all ones are not allowed (it is very important to remember this). So, with this in mind, these subnets have been created.

Subnetting
204.17.5.0 255.255.255.224 204.17.5.32 255.255.255.224 204.17.5.64 255.255.255.224 204.17.5.96 255.255.255.224 204.17.5.128 255.255.255.224 204.17.5.160 255.255.255.224 204.17.5.192 255.255.255.224 204.17.5.224 255.255.255.224 host address range 1 to 30 host address range 33 to 62 host address range 65 to 94 host address range 97 to 126 host address range 129 to 158 host address range 161 to 190 host address range 193 to 222 host address range 225 to 254

9.4.1:Subnets

9.5:ARP and RARP


9.5.1: ARP
Each host are two address :IP address and its MAC address which, since it is assign to the MAC integrated circuit when it is manufactured, is known also as the physical address Used to determine host address Both the addresses are stored in the configuration file of the host on the hard disk

9.5.2: RARP

ARP protocol
A knows B's IP address, wants to learn physical address of B A broadcasts ARP query pkt, containing B's IP address

all machines on LAN receive ARP query


B receives ARP packet, replies to A with its (B's) physical layer address A caches (saves) IP-to-physical address pairs until information becomes old (times out)

soft state: information that times out (goes away) unless refreshed
5: DataLink Layer 5a-35

Associated with each ARP is a routing table called ARP Cache Contains list of IP/MAC address-pairs of the hosts If ARP just resolved an IP address, chances are a few moments later someone is going to ask to resolve the same IP address When ARP returns a MAC address, it is placed in a cache. When the next request comes in for the same IP address, look first in TCP/IP Protocol Suite 36 the cache

The Cache Table

Routing to another LAN


walkthrough: routing from A to B via R

R B

5: DataLink Layer

5a-37

9.5:ARP and RARP


Routing table with ARP: ARP cache(IP/MAC address pair) ARP request message broadcast. ARP/RARP message is of size 28 bytes

ARP packet
Hardware Type - Ethernet is type 1 Protocol TypeIPv4=x0800 Hardware Length:length of Ethernet Address (6) Protocol Length:length of IPv4 address (4)

9.5.3:ARP/RARP message formats and transmission

Routing Tables and Address Masks


In practice, destination stored as network address Next hop stored as IP address of router Address mask defines how many bits of address are in prefix
Prefix defines how much of address used to identify network E.g., class A mask is 255.0.0.0 Used for subnetting

Routing Table for Center Router

Address Masks To identify destination network, apply address mask to destination address and compare to network address in routing table Can use Boolean AND if ((Mask[i] & D) == Dest[i]) forward to NextHop[i] Consider 128.1.15.26:

Forwarding IP Packets
Destination address in IP datagram is always ultimate destination Router looks up next-hop address and forwards datagram Network interface layer takes two parameters:
IP datagram Next-hop address

Next-hop address never appears in IP datagram

Frame size different in different LANS. IP address: netid, hostid. Internet network information center(InterNIC). MTU => maximum transmission unit Fragments. ARP:address resolution protocol OSPF:open shortest path first ICMP:internet control message protocol IGMP:internet group management protocol

Internet Protocol The IP in UDP/IP and TCP/IP


IP is the network layer
packet delivery service (host-to-host). translation between different data-link protocols.

Netprog 2002 TCP/IP

IP Datagrams
IP provides connectionless, unreliable delivery of IP datagrams. Connectionless: each datagram is independent of all others. Unreliable: there is no guarantee that datagrams are delivered correctly or at all.
Netprog 2002 TCP/IP

IP Addresses
IP addresses are not the same as the underlying datalink (MAC) addresses.

Why ?
Netprog 2002 TCP/IP

IP Addresses
IP is a network layer - it must be capable of providing communication between hosts on different kinds of networks (different data-link implementations). The address must include information about what network the receiving host is on. This makes routing feasible.
Netprog 2002 TCP/IP

The four formats of IP Addresses


Class A 0 NetID B
C D
10 NetID NetID HostID HostID

110
1110
8 bits
Netprog 2002 TCP/IP

HostID

Multicast Group ID
8 bits 8 bits 8 bits

Class A 128 possible network IDs over 4 million host IDs per network ID
Class B 16K possible network IDs 64K host IDs per network ID Class C over 2 million possible network IDs about 256 host IDs per network ID

Netprog 2002 TCP/IP

IP Addresses
IP Addresses are usually shown in dotted decimal notation: 1.2.3.4 00000001 00000010 00000011 00000100 cs.rpi.edu is 128.213.1.1
10000000 11010101 00000001 00000001

CS has a class B network


Netprog 2002 TCP/IP

Host and Network Addresses


A single network interface is assigned a single IP address called the host address. A host may have multiple interfaces, and therefore multiple host addresses. Hosts that share a network all have the same IP network address (the network ID).
Netprog 2002 TCP/IP

IP Broadcast and Network Addresses


An IP broadcast addresses has a host ID of all 1s. IP broadcasting is not necessarily a true broadcast, it relies on the underlying hardware technology. An IP address that has a host ID of all 0s is called a network address and refers to an entire network.
Netprog 2002 TCP/IP

9.3:Fragmentation and reassembly


If the size of a packet is greater than the MTU => router or gateway divides the information received in the packet into a number of smaller blocks knows as fragments Fig 9.4

IP Fragmentation & Reassembly


Network links have MTU (max.transfer size) - largest possible link-level frame. different link types, different MTUs large IP datagram divided (fragmented) within net one datagram becomes several datagrams reassembled only at final destination IP header bits used to identify, order related fragments fragmentation: in: one large datagram out: 3 smaller datagrams

reassembly

Different packet sizes When to re-assemble


At destination only

Fragmentation and Re-assembly

Results in packets getting smaller as data traverses internet

Why not re-assemble at intermediate routers?


Need large buffers at routers Buffers may fill with fragments All fragments must go through same router
Inhibits dynamic routing

Routers have enough work to do already without having to reassemble stuff

IP re-assembles at destination only Uses fields in header


Data Unit Identifier (ID)

IP Fragmentation

Identifies end system originated datagram if coupled with:


Source and destination address Protocol layer generating data (e.g. TCP) Identification supplied by that layer

Data length
Length of user data in octets

Offset
Position of fragment of user data in original datagram In multiples of 64 bits (8 octets)

More flag
Indicates that this is not the last fragment

IP Fragmentation and Reassembly


length ID moreflag offset =4000 =x =0 =0 One large datagram becomes several smaller datagrams length ID moreflag offset =1500 =x =1 =0 length ID moreflag offset =1500 =x =1 =1480 length ID moreflag offset =1040 =x =0 =2960

Fragmenting Fragments
A fragment may encounter a subsequent network with even smaller MTU
Router fragments the fragment to fit Resulting (sub)fragments look just like original fragments (except for size) No need to reassemble hierarchically; (sub)fragments include position in original datagram

Das könnte Ihnen auch gefallen