Ch13 Local Area Networks: Packets, Frames, & Tech

advertisement
Department of Engineering Science
ES465/CES 440, Intro. to Networking & Network Management
Local Area Networks: Packets, Frames, &
Topologies
http://www.sonoma.edu/users/k/kujoory
References
• “Douglas Comer, Computer Networks & Internet,” 6th ed, Pearson, 2014, Ch13.
• “Computer Networks,” A. Tanenbaum, 4th ed., Prentice Hall, 2002, ISBN: 0130661023.
• “Behrouz A. Forouzan, Data Communications Networking,” 4th ed, Mc-Graw Hill, 2007
• “Data & Computer Communications,” W. Stallings, Prentice Hall, 7th Ed., 2004.
• “Computer Networks: A Systems Approach," L. Peterson, B. Davie, 4th Ed., Morgan
Kaufmann 2007.
• References cited in the slides
Ali Kujoory
6/30/2016
Not to be reproduced without permission
1
Topics Covered
•
•
•
•
•
•
•
•
•
•
•
•
•
13.1 Introduction
13.2 Circuit Switching
13.3 Packet Switching
13.4 Local & Wide Area Packet Networks
13.5 Standards for Packet Format & Identification
13.6 IEEE 802 Model & Standards
13.7 Point-to-Point & Multi-Access Networks
13.8 LAN Topologies
13.9 Packet Identification, Demultiplexing, MAC Addresses
13.10 Unicast, Broadcast, & Multicast Addresses
13.11 Broadcast, Multicast, & Efficient Multi-Point Delivery
13.12 Frames & Framing
13.13 Byte & Bit Stuffing
Ali Kujoory
6/30/2016
Not to be reproduced without permission
2
13.1 Introduction
• This chapter
– begins the part of the text that examines packet
switching & computer network technologies
– explains the IEEE standards model
– concentrates on the concepts of hardware addressing
& frame identification
• Later chapters
– exp & the discussion by considering the use of packets
in Wide Area Networks
– cover a variety of wired & wireless networking
technologies that accept & deliver packets
Ali Kujoory
6/30/2016
Not to be reproduced without permission
3
13.2 Circuit Switching
• Circuit switching refers to a
communication mechanism
that establishes a path
between a sender & receiver
– with guaranteed isolation
from paths used by other
pairs of senders & receivers
• Circuit switching is usually
associated with legacy
telephone technology
6/30/2016
– Circuit switching networks
use electronic devices to
establish circuits
– Instead of having each circuit
correspond to a physical path
• multiple circuits are
multiplexed over shared media
– because a telephone system
provides a dedicated
connection between two
telephones
Ali Kujoory
• Fig. 13.1 illustrates the
concept
• & the result is known as a
virtual circuit
Not to be reproduced without permission
4
13.2 Circuit Switching
Ali Kujoory
6/30/2016
Not to be reproduced without permission
5
13.2 Circuit Switching
• Three general properties
define a circuit switched
paradigm:
– Point-to-point communication
• means that a circuit is formed
between exactly two endpoints
– Separate steps for circuit
creation, use, & termination
• distinguishes circuits that are
switched (i.e., established
when needed) from circuits
that are permanent
– Performance equivalent to an
isolated physical path
• circuit switching must provide
the illusion of an isolated path
for each pair of communicating
entities
• Switched circuits use a threestep process analogous to
placing a phone call
– a circuit is established
between two parties
– the two parties use the circuit
to communicate
– the two parties terminate use
• communication between two
parties is not affected in any
way by communication among
other parties
Ali Kujoory
6/30/2016
Not to be reproduced without permission
6
13.3 Packet Switching
• A packet switching system uses statistical multiplexing
– multiple sources compete for the use of shared media
• Fig. 13.2 illustrates the concept
Figure 13.2 A packet-switched network sending
one packet at a time across a shared medium.
Ali Kujoory
6/30/2016
Not to be reproduced without permission
7
13.3 Packet Switching
• A packet switching system requires
a sender to divide each message
into blocks of data that are known
as packets
– the size of a packet varies
2. No set-up required before
communication begins
– system remains ready to deliver a
packet to any destination at any time
• a sender does not need to perform
initialization before communicating
– each packet switching technology
defines a maximum packet size
• Three general properties define a
packet switching
1. Arbitrary, asynchronous
communication
– allows a sender to communicate with
one recipient or multiple recipients
• a given recipient can receive messages
from one sender or multiple senders
– system does not need to notify the
underlying system when
communication terminates
3. Performance varies due to
statistical multiplexing among
packets
– multiplexing occurs among packets
rather than among bits or bytes
– communication can occur at any time
• & a sender can delay arbitrarily long
between successive communications
Ali Kujoory
6/30/2016
Not to be reproduced without permission
8
13.3 Packet Switching
• One of the chief advantages of packet switching is the
lower cost that arises from sharing resources
• To provide communication among N computers
– With a circuit-switched network must have
• a connection for each computer plus at least N/2 independent paths
– With packet switching, a network must have
• a connection for each computer, but only requires one path that is
shared
Ali Kujoory
6/30/2016
Not to be reproduced without permission
9
13.4 Local & Wide Area Packet Networks
• Packet switching technologies are commonly classified according to
the distance they span
– The least expensive networks use technologies that span a short distance
(e.g., inside a single building)
– The most expensive span long distances (e.g., across several cities)
• Fig. 13.3 summarizes the terminology used
Figure 13.3 The three categories of packet switched networks.
Ali Kujoory
6/30/2016
Not to be reproduced without permission
10
13.5 Standards for Packet Format & Identification
• Each packet sent across
such a network must
contain the identification
of the intended recipient
• All senders must agree on
the exact details of how to
identify a recipient &
where to place the
identification in a packet
• Standards organizations
create protocol
documents that specify all
details
Ali Kujoory
6/30/2016
• Standards have been
created by various
organizations
– Institute for Electrical &
Electronic Engineers (IEEE)
is most famous
• In 1980, IEEE organized
the Project 802 LAN/MAN
Standards Committee to
produce standards for
networking
Not to be reproduced without permission
11
13.5 Standards for Packet Format & Identification
• IEEE is mostly composed
of engineers who focus on
the lower two layers of
the protocol
• In fact, if one reads the
IEEE documents
– it may seem that all other
aspects of networking are
unimportant
– each emphasizes particular
layers of the stack
6/30/2016
– Institute for Electrical &
Electronic Engineers (IEEE)
– World Wide Web Consortium
(W3C)
– Internet Engineering Task
Force (IETF)
• However, other standards
organizations exist &
Ali Kujoory
• Fig. 13.4 gives a humorous
illustration of a protocol as
viewed by various standards
organizations, such as
• Each standards organization
focuses on particular layers
of the protocol stack
Not to be reproduced without permission
12
13.5 Standards for Packet Format & Identification
Ali Kujoory
6/30/2016
Not to be reproduced without permission
13
13.6 IEEE 802 Model & Standards
• IEEE divides Layer 2 of the protocol stack into two
conceptual sub-layers, as Fig. 13.5 illustrates
– The Logical Link Control (LLC)
• Link establishment/termination, frame acknowledgment, frame
sequencing, frame traffic control & service access points
– The Media Access Control (MAC)
• sublayer specifies how multiple computers share underlying medium
• Frame delimiting, error checking, media access management
Figure 13.5 The conceptual
division of Layer 2 into sublayers
according to the IEEE model.
Ali Kujoory
6/30/2016
Not to be reproduced without permission
14
13.6 IEEE 802 Model & Standards
• IEEE assigns a multi-part
identifier of the form
XXX.YYY.ZZZ
– XXX denotes the category of
the standard
– YYY denotes a subcategory
– If a subcategory is large
enough, a third level can be
added
• Fig. 13.6 lists examples of
IEEE assignments
• IEEE has created many
working groups that are
each intended to standardize
one type of network
technology
Ali Kujoory
6/30/2016
– Each working group consists
of representatives from the
industrial & academic
communities; meets regularly
to discuss approaches &
devise standards
– IEEE allows a working group
to remain active provided the
group makes progress & the
technology is still deemed
important
– If a working group decides
that the technology under
investigation is no longer
relevant, the group can
decide to disband
Not to be reproduced without permission
15
Fig. 13.6
Examples of the
identifiers IEEE
has assigned to
various LAN
standards
Ali Kujoory
6/30/2016
Not to be reproduced without permission
16
13.7 Point-to-Point & Multi-Access Networks
• LAN technologies allow
multiple computers to
share
• Professionals say that
LANs connect computers
– a medium in such a way that
any computer on the LAN can
communicate with any other
– the term multi-access is
used to describe this &
– with the understanding that a
device such as a printer can
also connect to a multiaccess LAN
• we say that a LAN is a multiaccess network
• LAN technologies
generally provide direct
connection among
communicating entities
Ali Kujoory
6/30/2016
Not to be reproduced without permission
17
13.8 LAN Topologies
• Many LAN technologies have been invented
– How specific technologies are similar & how they differ?
• Each network is classified into a category according to its
topology or general shape
• This section describes four basic topologies that are used
to construct
–
–
–
–
13.8.1
13.8.2
13.8.3
13.8.4
Bus Topology
Ring Topology
Mesh Topology
Star Topology
• Fig. 13.7 illustrates the topologies
Ali Kujoory
6/30/2016
Not to be reproduced without permission
18
13.8 LAN Topologies
Ali Kujoory
6/30/2016
Not to be reproduced without permission
19
13.8.1 Bus Topology
• Bus topology usually
consists of a single cable
to which computers attach
• The ends of a bus network
must be terminated
– to prevent electrical signals
from reflecting back along
the bus
• Any computer attached to
a bus can send on the
cable &
• Because all computers
attach directly to the cable
– any computer can send data
to any other computer
• The computers attached
to a bus network must
coordinate
– to ensure that only one
computer sends a signal at
any time
– all computers receive the
signal
Ali Kujoory
6/30/2016
Not to be reproduced without permission
20
13.8.2 Ring Topology
• Ring topology arranges for
computers to be connected
in a closed loop
– a cable connects the first
computer to a second
computer, another cable
connects the second
computer to a third, & so on,
until a cable connects the
final computer back to the
first
– name ring arises because
one can imagine the
computers & the cables
connecting them arranged in
a circle as Fig. 13.7 illustrates
Ali Kujoory
6/30/2016
• In practice, the cables in a ring
network do not form a circle
• Instead, they run along
hallways or rise vertically from
one floor of a building to
another
• Ring topology requires a
computer to connect to a
small device that forms the
ring
– this is needed for the ring to
continue operation even if
some of the computers are
disconnected
Not to be reproduced without permission
21
13.8.3 Mesh Topology
• A network that uses a mesh topology provides a direct
connection between each pair of computers
• The chief disadvantage of a mesh arises from the cost:
– -n)/2)
– The important point is that the number of connections needed for
a mesh network grows faster than the number of computers
• Because connections are expensive
– few LANs employ a mesh topology in special circumstances
Ali Kujoory
6/30/2016
Not to be reproduced without permission
22
13.8.4 Star Topologies
• In star topology, all computers attach to a central point
• The center of a star network is often called a hub
• A typical hub consists of an electronic device
– that accepts data from a sending computer & delivers it to the
appropriate destination
• In practice, star networks seldom have a symmetric
shape (hub is located an equal distance from all
computers)
– Instead, a hub often resides in a location separate from the
computers attached to it
– E.g., computers can reside in individual offices, while the hub
resides in a location accessible to an organization's networking
staff
Ali Kujoory
6/30/2016
Not to be reproduced without permission
23
13.8.5 The Reason for Multiple Topologies
• Each topology has
advantages & disadvantages
• A ring makes it easy for
computers to coordinate
access & to detect whether
the network is operating
correctly
– However, an entire ring
network is disabled if one of
the cables is cut
• A star helps protect the
network from damage to a
single cable because each
cable connects only one
machine
Ali Kujoory
6/30/2016
• A bus requires fewer wires
than a star, but has the
same disadvantage as a ring
– a network is disabled if
someone accidentally cuts
the main cable
• Later chapters that describe
specific network
technologies
• Compare the topologies considering
cost, point of failure, construction,
efficiency, etc., .
Topologies
Advantages
Disadvantages
Bus
Ring
Star
Mesh
Not to be reproduced without permission
24
13.9 Packet Identification, Demultiplexing, MAC Addresses
• IEEE has created a standard for addressing
• Consider packets traversing a shared medium as Fig. 13.2 illustrates
Figure 13.2 A packet-switched network sending
one packet at a time across a shared medium.
Ali Kujoory
6/30/2016
Not to be reproduced without permission
25
13.9 Packet Identification, Demultiplexing, MAC Addresses
• Each packet that travels
across the shared medium is
intended for a specific
recipient &
– only the intended recipient
should process the packet
• Demultiplexing uses an
identifier known as an
address
• Each computer is assigned a
unique address &
– each packet contains the
address of the intended
recipient
Ali Kujoory
6/30/2016
• In the IEEE addressing
scheme, each address
consists of 48 bits; IEEE
uses the term Media
Access Control address (or
simply MAC address)
– networking professionals
often use the term Ethernet
address
• IEEE allocates a unique
address for each piece of
interface
– Each Network Interface Card
(NIC) contains a unique IEEE
address assigned when the
device was manufactured
Not to be reproduced without permission
26
13.9 Packet Identification, Demultiplexing, MAC Addresses
• IEEE assigns a block of addresses to each vendor &
– allows the vendor to assign a unique value to each device
– there is a 3-byte Organizationally Unique ID (OUI)
• OUI identifies the equipment vendor
• a 3-byte block that identifies a particular NIC
• Fig. 13.8 illustrates the division
Figure 13.8 The division of a 48-bit IEEE MAC address.
Ali Kujoory
6/30/2016
Not to be reproduced without permission
27
13.10 Unicast, Broadcast, & Multicast Addresses
• The IEEE addressing supports three types of addresses
– that correspond to three types of packet delivery
• Fig. 13.9 provides a summary
Figure 13.9 The three types of MAC addresses &
the corresponding meanings.
Ali Kujoory
6/30/2016
Not to be reproduced without permission
28
13.10 Unicast, Broadcast, & Multicast Addresses
• It may seem odd that the IEEE address format reserves a
bit to distinguish between unicast & multicast
– but does not provide a way to designate a broadcast address
• The standard specifies that a broadcast address consists
of 48 bits that are all 1s
– Thus, a broadcast address has the multicast bit set
• Broadcast can be viewed as a special form of multicast
– Each multicast address corresponds to a group of computers
– Broadcast address corresponds to a group that includes all
computers on the network
Ali Kujoory
6/30/2016
Not to be reproduced without permission
29
13.11 Broadcast, Multicast, & Efficient Multi-Point Delivery
• Broadcast & multicast addresses are useful in LANs
– because they permit efficient delivery to many computers
• To understand the efficiency
– recall that a LAN transmits packets over a shared medium
• In a typical LAN
–
–
–
–
each computer on the LAN monitors the shared medium
extracts a copy of each packet &
then examines the address in the packet
determine whether the packet should be processed or ignored
• Algorithm 13.1 gives the algorithm a computer uses to
process packets
Ali Kujoory
6/30/2016
Not to be reproduced without permission
30
13.11 Broadcast, Multicast, & Efficient Multi-Point Delivery
Ali Kujoory
6/30/2016
Not to be reproduced without permission
31
13.12 Frames & Framing
• Chapter 9 introduces the
concept of framing
– In synchronous
communication systems it is
used as a mechanism that
allows a receiver to know
where a message begins &
ends
• In more general terms,
framing refers to the
structure added to a
sequence of bits or bytes
that allows a sender &
receiver to agree on the
exact format of the
message
Ali Kujoory
6/30/2016
• In a packet-switched
network, each frame
corresponds to a packet
• A frame consists of two
conceptual parts:
– Header that contains
metadata, such as an
address
• Contains more information
used to process the frame
– Payload that contains the
message being sent &
• is usually much larger than the
frame header
Not to be reproduced without permission
32
13.12 Frames & Framing
• A message is opaque
– in the sense that the network only examines the frame header
– the payload can contain an arbitrary sequence of bytes that are
only meaningful to the sender & receiver
• Some technologies delineate each frame by sending a
short prelude before the frame & a short postlude after it
• Fig. 13.10 illustrates the concept
Figure 13.10 Typical structure of a frame in a packet-switched network.
Ali Kujoory
6/30/2016
Not to be reproduced without permission
33
13.12 Frames & Framing
• Assume that a packet header consists of 6 bytes
– the payload consists of an arbitrary number of bytes
• We can use ASCII character set
– Start Of Header (SOH) character marks the beginning of a frame,
&
– End Of Transmission (EOT) character marks the end
• Fig. 13.11 illustrates an example of the format
IEEE 802.3 & Ethernet Frame Header contain S & D MAC addresses each 6 octets),
IEEE802.1 (4 octets, optional), Length or Ether Type 2 octets.
SOH contains 7 octets of 1010101010 plus an octet of 1010,1011. Octets are transmitted LSB first.
https://en.wikipedia.org/wiki/Ethernet_frame
Ali Kujoory
6/30/2016
Not to be reproduced without permission
34
13.13 Byte & Bit Stuffing
• In the ASCII character set
– SOH has hexadecimal value 0x01
– EOT has the hexadecimal value 0x04
• An important question arises
– what happens if the payload of a frame includes one or more bytes
with value 0x01 or 0x04?
• The answer lies in a technique known as byte stuffing
– that allows transmission of arbitrary data without confusion
Ali Kujoory
6/30/2016
Not to be reproduced without permission
35
13.13 Byte & Bit Stuffing
• To distinguish between
data & control information,
such as frame delimiters
– The Sender changes a data
to replace each control byte
with a sequence
– The receiver replaces the
sequence with the original
one
– As a result, a frame can
transfer arbitrary data &
• the underlying system never
confuses data with control
information
Ali Kujoory
6/30/2016
• The technique is known
as byte stuffing
– the terms data stuffing &
character stuffing are
sometimes used
• A related technique used
with systems that transfer
a bit stream is known as
bit stuffing
• As an example of byte
stuffing, consider a frame
as illustrated in Fig. 13.12
Not to be reproduced without permission
36
13.13 Byte & Bit Stuffing
• Because SOH & EOT are used to delimit the frame
– those two bytes must not appear in the payload
• Byte stuffing reserves a third character to mark occurrences of
reserved characters in the data
– E.g., suppose the ASCII character ESC (0x1B) has been selected as the
third character
– When any of the three special characters occur in the data
• the sender replaces the character with a two-character sequence
• Fig. 13.12 lists one possible mapping
EOT = 0x04
ESC = 0x1B
SOH = 0x01
A = 0x41
B = 0x42
C = 0x43
Figure 13.12 A example of byte stuffing that maps each
special character into a 2-character sequence.
Ali Kujoory
http://benborowiec.com/2011/07/23/better-ascii-table/
6/30/2016
Not to be reproduced without permission
37
13.13 Byte & Bit Stuffing
• As the figure specifies, the sender replaces
– each occurrence of SOH by the two characters ESC + A
– each occurrence of EOT by the characters ESC + B, &
– each occurrence of ESC by the two characters ESC + C
• A receiver reverses the mapping
– by looking for ESC followed by one of A, B, or C & replacing the 2character combination with the appropriate single character
• Fig. 13.13 shows an example payload & the same
payload after byte stuffing has occurred
– Note that once byte stuffing has been performed, neither SOH nor
EOT appears anywhere in the payload
Ali Kujoory
6/30/2016
Not to be reproduced without permission
38
13.13 Byte & Bit Stuffing
Ali Kujoory
6/30/2016
Not to be reproduced without permission
39
Appendix
Ali Kujoory
6/30/2016
Not to be reproduced without permission
40
Circuit Switching vs Packet Switching
Intercity
Trunk
Subscriber
Loops
Physical copper
connection established
when call is made.
Circuit
Switching
End
Office
Connecting
Trunk
End
Office
Long-Distance
Office
Subscriber
Loops
Long-Distance
Office
Data packet
(Datagrams)
Receiver
Sender
Packet
Switching
Switches
Internet
Ali Kujoory
6/30/2016
Not to be reproduced without permission
41
What are the Sources of Delay
The delay may come from several sources.
• Voice/image digitizing/encoding
• Transmission
– Voice/image/data
compression/decompression
– Time to transmit the packets from the
computer & send them over the links
along the path
• Accumulation
– To collect several voice/image
samples in a packet before encoding.
• Processing
– Time to process the packets
– The lower the port / link capacity, the
larger the transmission delay.
– The larger the packet size, the larger
the transmission delay.
• Propagation
– Negligible for a fast processor
– Propagation of voice/data packets
across the media - air, fiber, wire
• Queuing
– Buffering time in the gateways and
routers along the path
– The longer the distance, the larger
the propagation delay.
– Can vary
– Depends on the medium – air, fiber,
wire
Ali Kujoory
6/30/2016
Not to be reproduced without permission
42
Propagation and Transmission Time
Channel
Transmitter
Receiver
SSU
NYU
“Message”
Point of reception
Point of launch
x
Transmission Time
Bits in transit
from transmitter
to receiver
x
x
X=0
Propagation Time
X=L
All bits have
been received
Transmission
Time
Transmission time – the time to output the bit sequence of the message.
Propagation time – the time for a bit to travel from transmitter to receiver.
Ali Kujoory
6/30/2016
Not to be reproduced without permission
43
Propagation and Transmission Time
Channel Distance (meter)
Propagation Time 
Propagatio n speed (meter/sec )
Message size (bits)
Transmissi on Time 
Transmissi on speed (bits/sec)
Total number of bits in message (bits)

bit rate (bits/sec)
Definition by approximation:
Latency ≈ Propagation Delay + Transmission Delay
More generally (because other factors may be present):
Latency = Propagation Delay + Transmission Delay
+ Queuing Delay + Processing Delay
Ali Kujoory
6/30/2016
Not to be reproduced without permission
44
Propagation and Transmission Speed
Propagation speed is the speed a bit travels over the channel medium of
length L (i.e., the distance from source to destination),
Distance L (meter)
Propagation speed 
Travel time (sec)
Transmission speed is the rate (units of bps) at which message bits arrive at
destination,
Number of bits transmitted (bits)
Transmission speed 
Transmission time (sec)
Ali Kujoory
6/30/2016
Not to be reproduced without permission
45
Download