Z-addrressing_in_lan..

Download Report

Transcript Z-addrressing_in_lan..

ADDR.PPT
Addressing in LANs
Version 1.0
by
Geoff Bennett
This presentation discusses addressing concepts for LOCAL Area Networks. The primary
difference between LAN and WAN addressing is that LANs are capable of supporting
broadcast or multicast address destinations. WANs are not normally able to do this.
Networks allow us to transmit information between one computer and another.
Part of this procedure is the use of addressing to make sure messages get to the right
place.
Transport Layer
Addressing
Schemes
Network Layer
LLC Layer
MAC Layer
Physical Layer
As we’ll see in this tutorial, addressing schemes exist at multiple layers of the OSI Model.
A typical TCP/IP packet will contain addresses that are designed to be used at the MAC
Layer, the Network Layer and the Transport Layer.
Transport Layer Addresses
Network Layer Addresses
MAC Layer Addresses
The addresses are stored in specifically defined parts of the IP packet and the LAN frame.
The consistent position of addresses is a key factor that allows software to interpret
addressing information correctly. In other words, if we put addresses in the wrong format,
or in the wrong place, our communication software will not work correctly.
Why Do We Need
Addressing?
Harry
Sally
In this diagram, let’s assume that Harry wants to send information to Sally.
Lets further assume that both computers are equipped with suitable interface circuits that
allow them to insert messages into the network.
Harry
Sally
If we just connect a cable between the two computers, then Harry’s software can simply
push the information into the cable, and it will inevitably end up at the right place.
You may have even used such a configuration if you’ve ever downloaded information using
modems, and software such as Kermit.
Harry
Curley
Sally
Larry
Moe
On a real network, such as Ethernet, Harry and Sally are not the only users of the
communication channel.
All of the computers attached to this network share the same communication channel.
Addressing is used to ensure that messages between any two of these machines are not
received by other users.
Transport Layer
Network Layer
LLC Layer
MAC Layer Addressing
MAC Layer
Physical Layer
Harry
Sally
MAC Layer Addressing is often explained in terms of security. In other words, all the
stations are on the same network and MAC Addressing ensures that one stations cannot
receive messages intended for another station. However, this is a naive way to think of
MAC Addressing, since it is so easy to bypass this security.
Instead, we should regard MAC Addressing as a way to ensure that other LAN users are
not forced to process messages that are actually being sent to someone else.
• Local Wire Address
There are several phrases used to describe MAC Layer Addressing. They are all identical
in meaning.
Local Wire Address is a slang phrase, and refers to the fact that the reason for the
addressing scheme is to differentiate LAN stations that are attached to the same cable. I
tend not to use this term because it is not such a good description in these days of LAN
switches and multiport bridges.
• Local Wire Address
• Physical Address
Physical Address is the term used in RFC documents to describe the MAC Address. I
believe it came into use because the MAC Address is tied to the physical host from which
the frame originates, or to which it is directed.
• Local Wire Address
• Physical Address
• MAC Address
MAC (Media Access Control) address is a term that’s used throughout the industry, and it’s
the one I’ve grown used to. It is at the MAC Layer of the OSI Model that these addresses
have significance.
+5V
-5V
...1101011010...
At the Physical Layer of the OSI Model, electrical signals are interpreted as a series of
binary 1’s and 0’s.
The Physical Layer functions don’t make any attempt to interpret these bits in any way.
Direction of Transmission
FLAG
DA
SA
FRAME
CRC
FLAG
At the MAC Layer, the 1’s and 0’s are interpreted into a structure called a Frame.
Frames are the lowest level collection of information on a LAN.
Frames can be quite long. On Ethernet, they are up to 1.5kB (about 12 000 bits), on Token
Ring up to 18kB and on FDDI up to 4kB.
The smallest frame size is also specific to a given LAN technology. Ethernet has a
minimum of 64 bytes.
Direction of Transmission
FLAG
DA
SA
CRC
FLAG
Frames have a structure that is specific to the LAN technology. Ethernet, Token Ring and
FDDI frames are all slightly different in structure.
This diagram is a generic view of a frame.
The bits in the frame are transmitted in order from left to right. This is the typical
convention used in most textbooks.
Direction of Transmission
FLAG
DA
SA
CRC
FLAG
The first feature of a frame is some form of delimiter, or flag. Flags are some special bit
pattern, or line encoding, that allows the LAN circuits to identify the beginning and ending
of the frame.
Direction of Transmission
FLAG
DA
SA
CRC
FLAG
On Ethernet, the flag at the start of the frame is a series of 62 bits alternating 1 and 0, and
then two bits set to 1. Ethernet and IEEE standards refer to this field as the preamble.
Another major use for the preamble is to allow LAN adapters to “lock on”, or synchronise
with the clock signal that is contained within the bitstream encoding.
The ending delimiter is actually a “gap” in transmission - this must last at least 9.6
microseconds, but will be longer if no other station is ready to transmit. Ethernet and IEEE
standards refer to this as the interframe gap.
Direction of Transmission
FLAG
DA
SA
CRC
FLAG
In Token Ring and FDDI technologies, the flags are represented by special line coding.
For Token Ring, the coding is actually a controlled violation of the Manchester Encoding
scheme.
For FDDI, special 5-bit symbol patterns are reserved for flags.
Direction of Transmission
FLAG
DA
SA
CRC
FLAG
Towards the end of the frame is a field called the Cyclic RedundancyCheck (CRC). This is
used to check for frame corruption.
Direction of Transmission
FLAG
DA
SA
CRC
FLAG
At the beginning of the frame are the two MAC Address fields. The first of these fields is
the Destination Address (DA), and the second is the Source Address (SA).
For Harry’s message to Sally, Harry would insert Sally’s MAC Address in the DA field, and
his own MAC Address in the SA field.
MAC Address Structure
FLAG
DA
SA
CRC
FLAG
Although frames are specific to a given LAN technology, the most popular modern
technologies (Ethernet, Token Ring and FDDI) all use the same address structure.
48 bits
0000000000000000000000000000000010110101...
FLAG
DA
SA
CRC
FLAG
This MAC address structure is defined by the IEEE 802 committee, and is 48 bits long.
As you can see, representing these addresses in binary is a bit tedious, and so we
normally write the address in hexadecimal. A 48 bit address can be written as 12 hex
digits.
We use hex rather than decimal because there is a further structure to the 48 bit address.
2
0
0
0
4
3
4
D
7
1
Here’s a typical IEEE MAC address, divided into hex digits.
equivalent of 4 bits.
5
E
Each hex digit is the
2
0
0
0
4
3
4
D
7
1
5
E
Binary Representation= 0010
G/I Bit
The first two bits of the address have a special significance.
The first bit is known as the Group/Individual (G/I) bit.
If this bit is clear (ie. 0), then the address is a Unicast address. This means that the frame
is addressed to only one possible LAN interface.
If the G/I bit is set (ie. 1) then the frame is a Broadcast or Multicast.
2
0
0
0
4
3
4
D
7
1
5
E
Binary Representation= 0010
G/L Bit
The second bit is known as the Global/Local (G/L) bit.
If this bit is clear, then this MAC address has been allocated from a block of addresses
which is registered with the IEEE. In this case, no other LAN interface in the universe
should have an identical address. In other words, this is a Globally Administered address.
If the bit is set, then this address was created by the local LAN administrator, and it may
not be globally unique. In other words, it is a Locally Administered address.
Assigned by IEEE
2
0
0
0
4
3
4
D
7
1
5
E
Allocated by Organisation
For globally administered addresses, the IEEE allocates a 24 bit address block to
organisations that apply.
Once the block is allocated, the organisation is responsible for uniquely assigning
addresses within its own block.
Large organisations (such as DEC and IBM) have multiple 24 bit blocks.
Organisation
Address Block
Cisco
00000Ch
DEC
08002B (et. al.)
IBM
08005A (et. al)
Sun
080020h
Proteon
000093h
Wellfleet
0000A2h
Here are a few examples of IEEE-assigned address blocks. A complete list can be found
in the latest version of the “Assigned Numbers” RFC.
MAC Addresses in Action
Address Chip
Let’s say that Joe Bloggs Inc. apply to the IEEE and are given the 24 bit block “200043”.
No other organisation will ever be given the same address block.
Joe Bloggs manufacture an Ethernet interface, and assign the remaining 24 bits. They
then “install” this address into a permanent memory device (a PROM or PAL chip) on the
interface.
No other LAN interface (even Token Ring or FDDI interfaces) should ever be assigned this
address by Joe Blogss.
If we were always able to use Globally Administered addresses, we could be sure that no
two machines in the world are using the same MAC address.
So you might think that MAC addresses are all we need to send LAN traffic between any
two machines in the world.
Unfortunately this is not true, for two reasons...Local Addressing and Scaleability.
Local Addressing - How?
Address Chip
If IEEE-registered addresses are installed in every LAN card, how can we use local
addressing?
The answer is simple. When the chipset on a LAN interface is activated, it reads the MAC
address from the chip. Communication software can then write a different address to the
chip, and so allow locally administered addressing.
Some chipsets are even able to accept multiple MAC addresses to operate simultaneously.
6
0
0Local
0
Addressing
- Why?
4
3
4
D
7
1
5
E
Binary Representation= 0110
G/L Bit
For a locally administered address, we set the G/L bit to “warn” other end stations that this
address does not have global significance.
But why should we bother to use local addresses when the IEEE procedure guarantees
that addresses will never be duplicated.
There is no single answer to this question, just a set of industry stories...
Local Addressing - Scaleability
Local
Address
Domain
Router
Local
Address
Domain
Router
If we adopt local address administration, we may be able to build networks within our own
domains of control. Perhaps this domain consists of the building in which we work, or even
just the floor where our workgroup is located.
In order to connect local address domains without worrying about MAC Address
duplication, we use Routers.
Routers make their decisions based on Network Layer Addressing.
Transport Layer
Network Layer Addressing
Network Layer
LLC Layer
MAC Layer
Physical Layer
Transport Layer Addresses
Network Layer Addresses
MAC Layer Addresses
Network Layer addresses are found inside the Data Field portion of the frame.
IP Addressing Basics
• IPv4 addresses are usually written as four separate
numbers delineated by a period
– For example: 101.209.33.17
• This way of representing an IP address is called
the dotted-quad notation
• Each number in the four-number group is
represented as an 8-bit octet in an IPv4 header
– For example: 101.209.33.17 would be represented as:
– 01100101 11010001 00100001 00010001
More IP Addressing Basics
• In IPv4, each 32-bit IP address is
subdivided into network and host/node
portions
• The composition of the first four bits in the
IP address specifies whether the network
portion is 1, 2, or 3 bytes in length
– These four bits determine whether the
host/node has a Class A, B, C, D, E address
(see Table 4-1)
For IP, the structure of the address is relatively simple.
We take a 32 bit address.
For IP, the structure of the address is relatively simple.
We take a 32 bit address
Divide it into 4, 8-bit fields.
the dotted-quad notation
202
34
For IP, the structure of the address is relatively simple.
We take a 32 bit address.
Divide it into 4, 8-bit fields..
Then we evaluate each field separately in decimal.
19
8
202
34
19
8
For IP, the structure of the address is relatively simple.
We take a 32 bit address.
Divide it into 4, 8-bit fields.
Then we evaluate each field separately in decimal.
And we write down these values with the individual byte-fields separated by dots. This is
called dotted decimal notation.
IP Addresses
 given notion of “network”, let’s re-examine IP
addresses:
“class-full” addressing:
class
A
0 network
B
10
C
110
D
1110
1.0.0.0 to
127.255.255.255
host
network
128.0.0.0 to
191.255.255.255
host
network
multicast address
32 bits
host
192.0.0.0 to
223.255.255.255
224.0.0.0 to
239.255.255.255
IPv4 Address Classes
IPv4 Classes
Default subnet masks.
The logical AND operation applied to 2 bits and the results.
Default subnet mask applied to a Class C address.
A subnet mask applied to a Class C address.
IP Addressing: introduction
 IP address: 32-bit
identifier for host,
router interface
 interface: connection
between host/router
and physical link



routers typically have
multiple interfaces
hosts may have
multiple interfaces
IP addresses
associated with each
interface
223.1.1.1
223.1.2.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.9
223.1.3.27
223.1.2.2
223.1.3.2
223.1.3.1
223.1.1.1 = 11011111 00000001 00000001 00000001
223
1
1
1
IP Addressing
 IP address:
 network part (high
order bits)
 host part (low order
bits)
 What’s a network ?
(from IP address
perspective)
 device interfaces with
same network part of
IP address
 can physically reach
each other without
intervening router
223.1.1.1
223.1.2.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.9
223.1.3.27
223.1.2.2
LAN
223.1.3.1
223.1.3.2
network consisting of 3 IP networks
(for IP addresses starting with 223,
first 24 bits are network address)
IP Addressing
 How to find the
networks?
 Detach each
interface from
router, host
 create “islands of
isolated networks
223.1.1.2
223.1.1.1
223.1.1.4
223.1.1.3
223.1.9.2
223.1.7.0
223.1.9.1
223.1.7.1
223.1.8.1
223.1.8.0
223.1.2.6
Interconnected
system consisting
of six networks
223.1.2.1
223.1.3.27
223.1.2.2
223.1.3.1
223.1.3.2
IP addresses: how to get one?
 Q: How does host get IP address?
 hard-coded by system admin in a file
Wintel: control-panel->network->configuration>tcp/ip->properties
 UNIX: /etc/rc.config
 DHCP: Dynamic Host Configuration Protocol:
dynamically get address from as server
 “plug-and-play”

IP addresses: how to get one?
 Q: How does network get network part of IP
addr?
 A: gets allocated portion of its provider
ISP’s address space
ISP's block
11001000 00010111 00010000 00000000
200.23.16.0/20
Organization 0
Organization 1
Organization 2
...
11001000 00010111 00010000 00000000
11001000 00010111 00010010 00000000
11001000 00010111 00010100 00000000
…..
….
200.23.16.0/23
200.23.18.0/23
200.23.20.0/23
….
Organization 7
11001000 00010111 00011110 00000000
200.23.30.0/23
IP addressing: the last word...
 Q: How does an ISP get block of
addresses?
 A: ICANN: Internet Corporation for Assigned

Names and Numbers
 allocates addresses
 manages DNS
 assigns domain names, resolves disputes
Reserved IP Addresses
• The developers of the IPv4 addressing
scheme reserved three blocks of addresses
for networks that would not be connected to
the Internet
– These are identified and defined in RFC 1918
• Reserved address ranges are illustrated in
Table 4-3
Table 4-3
Domain Names and URLs
• When a domain name is included in a URL, it must be resolved to an
IP address
• This is done by the Internet’s Domain Name System (DNS)
• Domain names and their IP addresses are stored in databases on
domain name servers
• When a domain name must be resolved, a message is sent to the
closest domain name server to obtain the IP address. If that server does
not know the IP address, it sends a request to other domain servers for
the information
• Once the IP address for a domain name is known, the host/node inserts
the IP address as the destination address for the packet so that it can be
routed to appropriate recipient
Subnet Addressing
• Because there is a limited number of available
IPv4 addresses, IPv4 developers provided
mechanisms for sharing a single network address
among two or more subnets
– These mechanisms are described in RFC 950
– RFC 950 enables class A, B, and C networks to be split
into smaller networks that use the same network
assignment numbers
Subnetting Advantages
• Subnetting has the following advantages:
– It simplifies network administration; each network
segment can be maintained independently and
efficiently
– Intranets can be restructured without affecting the
overall network’s interfaces with the Internet and other
external networks
– Because intranet subnetting is not visible to external
networks it can be used to enhance the overall security
of the organization’s networks
Subnetting Basics
• Subnetting enables network managers to
extend the network portion of IPv4
addresses by taking away a portion of the
host/node portion of the IP address
• The portion that is taken away is used as a
subnet identifier
• This is illustrated in Figure 4-4
Figure 4-4
Subnet Masks
• A subnet mask is a binary bit pattern that is stored in hosts, nodes, and
routers
• It is matched up with an incoming packet’s destination IP address to
determine whether to accept or reject the packet
• Every TCP/IP network host/node or router stores a subnet mask along
with its IP address (see Figure 4-6)
• The subnet mask specifies which bits in an IP address should be treated
as an extended network address (network + subnet) and which bits
represent the host/node portion of the address
• Default subnet masks exists for class A, B, and C networks (see Table
4-9)
• Table 4-10 summarizes alternative class C subnet masks
• Figure 4-5 illustrates how a subnet mask is used to decompose an IPv4
address into its subnet and host/node addresses
Figure 4-6
Table 4-9
Table 4-10
Figure 4-5
Static vs. Dynamic IP Addresses
• Host/node addresses can be allocated in one of two ways:
– Static assignments
– Dynamic assignments
• Static IP addresses are permanently assigned to hosts and
node
– Servers and routers are typically assigned static IP addresses
– These can be assigned to hosts/nodes through manual
configuration or by always assigning the same IP address to a
particular host/node when it comes online
• Dynamic IP addresses are automatically assigned to client
stations in a TCP/IP network when they come online
– DHCP servers assign dynamic IP addresses to clients
Internet Addressing in LANs
• Additional addressing processes take place when the
host/node that needs to connect to the Internet is in a LAN
• In LANs, physical (MAC) addresses (the address of the
computers’ network interface cards) are used for message
delivery
• When a LAN host/node has both an IP address and a MAC
address, an incoming IP packet can only be delivered to the
computer after the IP address has been translated to a MAC
address
• The protocol that performs this function is address
resolution protocol (ARP)
Address Resolution Protocol (ARP)
• ARP servers maintain tables that contain host/node IP
addresses and corresponding MAC addresses (see Table 412)
• If the destination node’s IP address is in the ARP table, it
extracts the corresponding MAC address and uses it to
build the MAC header needed to send the message to the
node
• ARP is found at the Internet layer of the TCP/IP protocol
stack (see Figure 4-10) but is often described as
overlapping the Internet and media access layers because
of its role in translating IP to MAC addresses
Table 4-12
Figure 4-10
RARP Illustrated (Example I)
Here’s my MAC
address. What is my
IP address ?
0800.0020.1111
Ethernet : 0800.0020.1111
IP = ????
IP = 131.108.3.1
I know who you are,
here’s your IP
address
131.108.3.2
RARP Illustrated (Example II)
Ports and Sockets
• Once received by the destination host/node, a packet progresses up the
layers of the TCP/IP protocol stack and is directed to the appropriate
application
• Port numbers are included in TCP or UDP headers to identify the
application layer protocol that generated the data in the packet
• Some port numbers are permanently assigned to applications/services
(see Table 4-15)
• The combination of an IP address and a port number is called a socket
– For example, the socket notation for a Web page request on a Web
server whose IP address is 141.165.231.193 would be
141.165.231.193:80
Examples of Well-Known Ports
Table 4-15
202
34
Network ID
19
8
Host ID
IP addresses have an additional structural element. Part of the address is reserved to
indicate the Network ID, while the semainder of the address represents the Host ID. The
relative sizes of the Network and Host ID fields vary with the class of IP address.
Using the Network ID, routers can direct traffic over multiple hops until it reaches the
correct network.
The final router in the path will use the Host ID to perform an Address Resolution, and find
out the correct MAC address of the destination host.
H
H
H
H
H
H
H
H
In the case of the worldwide Internet, there are over one million hosts already attached,
and the connection rate is still increasing.
Without a hierarchical form of addressing, then internetwork routers would need to
remember where every individual host was located.
With hierarchical addressing, each router only needs to track the hosts that are connected
to networks on the router.
Hierarchical addressing is used in another global network - the Telephone System.
663 6676
International Prefix
Area Code
Local Exchange
Subcriber Extension
This is a telephone number in the USA. It has 7 digits, which means that up to 10 million
subscribers can be addressed individually.
This is a lot, but not enough for a national, or international addressing scheme.
Even the seven digits are actually divided into the Local Exchange, and the Subscriber
Extension.
508
663 6676
International Prefix
Area Code
Local Exchange
Subcriber Extension
To extend the numbering scheme, US numbers add an area code.
Area codes are three digits long.
1
508
663 6676
International Prefix
Area Code
Local Exchange
Subcriber Extension
If we want to call this number from outside the US, we need to add the International Prefix.
For the USA, this is 1, for the UK, 44, for Germany 49 etc.
International
Exchange
National
Exchange
Ext.
Ext.
Ext.
Local Exchange
(or PBX)
National
Exchange
Local Exchange
(or PBX)
Local Exchange
(or PBX)
This hierarchical numbering scheme is essential to the telephone system. By isolating the
scope of individual telephone numbers, we gain a number of advantages.
First, human users of the system only need remember seven digits for any local number.
Second, a national PTT can adopt any reasonable internal structure for its numbering. It is
“protected” from address duplication and confusion by the International Prefix.
Finally, and most important, any given telephone exchange only needs to know about
addresses below it the hierarchy.
Internet
Router
Backbone
Backbone
Router
Backbone
Router
Backbone
Router
Router
Joe Bloggs’
Autonomous
System
The
Internet
Internet
Router
Backbone
Backbone
Router
Backbone
Router
Backbone
Router
Router
Jane Doe’s
Autonomous
System
I’d like to concentrate on this final advantage, because it’s the primary reason we use
hierarchical addressing in data networks.
The most obvious evidence of address hierarchy is that used in the Internet for protecting
one subscriber from routing errors made by another subscriber. This concept is, of course,
the Autonomous System (AS).
Internet-attached routers must recognise AS concepts, and must terminate local routing
protocol updates such as RIP or OSPF.
Internet
Router
The
Internet
Corporate Backbone
Backbone
Router
Backbone
Router
Backbone
Router
Backbone
Router
The next level in the hierarchy are the Backbone Routers, used to build the Corporate
Backbone.
Backbone routers operate within an AS, but may need to maintain large routing tables
depending on the size of the individual organisation.
Internet
Router
Backbone
Router
Access
Router
At the lowest level of router hierarchy are the Access Routers. These devices are much
smaller, less powerful, and cheaper than their more complex cousins.
Access Routers may be used to connect a single LAN workgroup into the Corporate
Backbone, and don’t need to maintain complex routing tables.
Regardless of the type of router used, all of these devices make their switching decisions
based on the Network Layer addressing I have just described.
Transport Layer Addressing
Transport Layer
Network Layer
LLC Layer
MAC Layer
Physical Layer
Finally I’d like to look at Transport Layer addressing.
Just to recap, we can say that MAC Layer addressing allows us to transfer messages
between two hosts on the same cable.
Network Layer addressing extends this communication ability so that we can cross multiple
intermediate networks to get from one host to another. Network Layer addressing is also
scaleable because the network designer can choose the addresses in a hierarchical way.
Program 1
Program 2
From the
Network
Here we see a LAN frame heading towards a PC from the network. MAC and Network
Layer addressing have got the frame this far, but now there’s a problem.
There are two possible communication programs running in the PC - Program 1 and
Program 2.
The MAC and IP addresses on the PC only identify the machine itself, not the program to
which the packet should be sent.
Program 1
Program 2
From the
Network
To differentiate between these programs, we use Transport Layer addressing.
Note that it’s not really practical to use IP addresses on a per-program basis for a couple of
good reasons. First of all, you’d have to register each program with an IP address when it
started. Because IP addresses are assigned manually, the Network Administrator would
have to limit the number of programs you can run from a machine so she would be able to
pre-assign your IP addresses.
More critically, there are too few IP addresses to really do this in practice.
To Summarize...
MAC Layer
Physical Layer
MAC Layer Addresses are used to allow private communication between specific hosts,
even though they share the same communication channel with many other systems.
Network Layer
MAC Layer
Physical Layer
Network Layer Addressing allows communication between hosts regardless of the type of
network (or networks) that are used to connect the hosts.
Transport Layer
Network Layer
MAC Layer
Physical Layer
Transport Layer Addressing allows a specific application process running in a host
computer to communicate with an equivalent process running in another host.
The End