LAN basic

advertisement
Local Area Networks (LANs)
LAN Topologies
 LANs can be organised in a number of ways
 Bus
• A number of devices tap into a common shared
medium
• Terminating resistances at either end prevent the
disruptive reflection of signals
LAN Topologies (2)
 Tree
• The tree topology is an extension of the bus topology
• A tree can have numerous ‘branches’, and the ‘root’ of
the tree is known as the ‘headend’
• Allows a much more complex layout than a bus
topology
LAN Topologies (3)
 Issues with Bus and Tree Topologies
• Any signal transmitted by one station is received by
all
o There must be a way to indicate who the transmission is
intended for. LANs send data in frames, which contain an
address field to indicate which station the frame is for
• If two stations transmit at the same time, the signals
collide and disrupt each other
o There must be some means of regulating who can transmit
and when. This process is known as Medium Access Control,
or MAC
LAN Topologies (4)
 Ring
• Consists of a set of repeaters joined by point to point
links that form a ring
• Stations attach through repeaters
• Data is transmitted in one direction only
 Ring (continued)
• Data is transmitted in
frames
• Stations monitor passing
frames and copy any
that are addressed to
them
• Frames are removed
once they have
circulated back to the
sender
• MAC is needed so that a
station doesn’t transmit
while a frame is passing
by. E.g. Token Ring
LAN Topologies (6)
 Star
• Devices connect to some central node, typically by
two point to point links (send and receive)
LAN Topologies (7)
 Star (continued)
 For a star topology, there are two alternatives
for the central node
• Broadcast – the node simply sends any frames it
receives to all output links
o This essentially joins all the links together and makes them
appear like one medium, i.e. a bus/tree
o The node is known as a ‘hub’ or ‘repeater’
• Switching – this requires the central node to be
‘intelligent’
o The node must analyse the address of incoming frames and
‘switch’ the frame to the correct outgoing link
Medium Access Control
 A means of controlling access to the medium to
promote orderly and efficient use
 Two points to consider – where and how
 Where – is control of the medium distributed or
centralised?
• Centralised – a device is designated to have authority
to grant access to the medium. Any other device
must wait for permission before it can transmit
• Distributed – devices collectively implement a MAC
function to determine who has access to the medium
Medium Access Control (2)
 There are advantages and disadvantages to a centralised
scheme
•
•
•
•
•
A centralised scheme provides a common point of failure
Can act as a bottleneck
Allows greater control of access
Allows simple access logic at each station
Avoids the problem of distributing control
 How – can be categorised as synchronous or asynchronous
 Synchronous – a specific capacity is dedicated to a
connection, as in circuit switching and multiplexing
techniques
• This is generally inefficient for computer communications, as the
demands of each station are unpredictable
• It is better to be able to allocate access to the medium in a dynamic
(asynchronous) fashion
Medium Access Control (3)
 Asynchronous – this is the most commonly used
MAC method, and can be divided into three
categories
• Round Robin – each station in turn is given the
chance to transmit
o This offer may be declined or accepted
o In a distributed round robin system, each station passes
control to its immediate neighbour when it has finished with
the medium. This is commonly used with a ring topology
Medium Access Control (4)
 Asynchronous (continued)
• Reservation – similar to synchronous MAC in that a
certain capacity is dedicated to a station
o In this case the allocation is by reservation, rather than fixed
o Reservations (time slots on the medium) can be made in a
distributed or centralised fashion
• Contention – no cooperation is used
o When a station wants to transmit, it goes ahead without
waiting for permission
o This is fine when not many stations want to transmit at
once, but tends to fail under heavy load
LAN Protocol Layers
 A LAN uses a MAC layer to control access to the
medium. This generally sits above the physical
layer
MAC Layer
MAC Layer
MAC Layer
Physical Layer
Physical Layer
Physical Layer
 The MAC layer provides
•
•
•
•
Framing
Error detection – Cyclic Redundancy Check (CRC)
Addressing
Controlled access to the medium
LAN Protocol Layers (2)
 MAC frames differ for different LAN
technologies, but generally they all have the
following attributes
MAC
Frame
MAC
Control
Destination
Source
MAC Address MAC Address
Data
CRC
• Control – carries specific control information
• Destination address – who the frame is destined for
(physical)
• Source address – who sent the frame (physical)
• Data – information the frame is transporting
• CRC – used to verify that the frame is correct
LAN Protocol Layers (3)
 The MAC does not provide
• Error correction
• Flow control
 Thus it does not provide all of the requirements of a
‘Data Link Layer’
 Some LANs use another layer, that sits above the MAC
layer, to provide these remaining functions
• LLC (HDLC derivative)
LLC Layer
LLC Layer
LLC Layer
MAC Layer
MAC Layer
MAC Layer
Physical Layer
Physical Layer
Physical Layer
LAN Protocol Layers (4)
 Logical Link Control (LLC)
• LLC is used to provide error correction and flow control
over a MAC layer
• The MAC layer already provides CRC checking and
addressing
• DSAP and SSAP – these specify the user (higher-layer
protocol) the frame is for on the destination device, and
the user it is from on the source device. Typically these
are the same
• Information – the data that the frame is carrying
LAN Protocol Layers (5)
 LLC specifies three methods for transferring
data (known as ‘services’)
 Connection-mode service – similar to HDLC
• A ‘connection’ is established with the destination
station, and information is transferred using
sequence numbers for flow and error control
 Unacknowledged connectionless service
• There is no ‘connection’, no flow control, and no error
correction
 Acknowledged connectionless service
• No connection is established, but an
acknowledgement is required for each frame, i.e.
stop-and-wait flow control/error correction
LAN Protocol Layers (6)
Data
Data Link Layer
Physical Layer
Theoretical data
communications
protocol stack
LLC Layer
MAC Layer
Physical Layer
LLC Header
MAC Header
Data
Data
CRC
001000101011100101010010101000010010101
LAN protocol
stack
 The LLC layer provides an interface for higher protocol
layers
• Software written to interact with LLC will easily port to devices on
different types of networks, provided that there is an LLC layer
Issues with Bus/Tree Topologies
 Due to signal attenuation, a received signal is
always weaker than when it was transmitted
 If it is too weak, then it becomes error prone, or
unrecoverable
 This is a problem with large bus/tree LANs as
any station must be able to communicate with
all others, no matter what distance they are
away
A
B
C
…
X
Y
Z
 This problem is usually
solved by using
repeaters to divide the
medium into smaller
segments
 Repeaters relay digital
signals in both
directions, making the
segments appear like
one medium
 As repeaters recover
the digital signal, they
remove any attenuation
Bus/Tree LANs
 The most popular medium for bus/tree LANs is coaxial
cable
• The physical layer can use either digital or analogue signals. In
LAN terminology these are called baseband and broadband
respectively
 Baseband
• A LAN baseband physical layer typically uses manchester or
differential manchester encoding
• Digital signals do not cope with branching very well. Hence,
baseband signalling is used with bus, rather than tree topologies
• Digital signals propagate both ways from a tap, spreading to
neighbouring stations on the bus
• Length of bus is restricted to a few kilometres at most due to
the attenuation of the high frequency components
• FDM (frequency division multiplexing) not possible with digital
signals as signal uses entire bandwidth
Bus/Tree LANs (2)
 Broadband
•
•
•
•
•
Uses analogue signals (hence each station has a modem)
FDM is possible
Branching is possible, so bus or tree topologies can be used
Distances up to 10 km possible
Amplifiers (as opposed to repeaters) are used for signal
regeneration
o Amplifiers are unidirectional, which means that broadband LANs have
to provide for two data paths (send and receive) – typically FDM is
used or there are two physically separate cables
• Broadband LANs have been used by cable TV companies to provide
interactive services over existing coaxial cable networks
• Hardly ever installed from scratch these days
Issues with Ring Topologies
 A ring LAN consists of a number of point-to-point links
joining repeaters
• Repeaters regenerate data and pass it on to the next repeater in the
ring
• Each repeater also serves as a station connection point
• Each repeater must be able to receive data, insert data and remove
data
Issues with Ring Topologies (2)
 To receive data, the repeater sends a copy of the data to
the attached station, and passes the data on to the next
repeater
• Repeater has knowledge of the packet format in order to scan
addresses and control information
• Some control strategies may allow the repeater to modify a bit as it
passes by – can be used to acknowledge a packet
Issues with Ring Topologies (3)
 Sending data and removing data happen at the same time,
as the only time data has to be removed is when the station
is sending a new frame
 When transmitting, data may appear on the incoming link.
This data could be
• From the same packet the transmitter is still in the process of
sending (will happen if the ‘bit length’ of the ring is shorter than the
packet)
• From some other packet (if multiple packets can be on the ring at the
same time) – the repeater buffers these to transmit later
Issues with Ring Topologies (4)
 The distance covered and number of stations can be greater
in a ring than a simple baseband bus, as each link
regenerates the digital signal and thus attenuation problems
are avoided
 However, a problem known as ‘timing jitter’ restricts this
• Each station aligns its clock to the received data stream and uses this
clock for sending data
• The next station does the same, but any small error gets passed from
station to station, getting magnified (or diminished)
• This means that the clock ‘jitters’ and this can cause bits to be lost
• The more stations in the ring, the greater the effect
 Other problems with rings
• A break anywhere in the ring brings down the entire LAN
• The ring has to be broken to insert a new station
Issues with Star Topologies
 Star topologies are common
when twisted pair is used for
the medium
• twisted pair has poor noise
immunity and thus tapping it as a
bus results in very poor signals
• Twisted pair is usually used for
point to point connections –
hence the ‘star’ topology
• A hub or repeater joins the
twisted pair so that logically they
appear to be all one medium
Issues with Star Topologies (2)
 Why use twisted pair when it has poor capabilities
compared to coaxial cable?
• It is already installed in many buildings for telephone purposes
• When used for a LAN, saves the significant cost of installing
special cable
 Recently, intelligent ‘switches’ have been used instead of
hubs
• A switch determines which station is on each connection and
sends frames to the appropriate output line
• At the same time, other unused lines can be used for switching
other traffic
• This significantly improves the efficiency of the LAN under heavy
load and has made star topologies popular
Issues with Star Topologies (3)
 Star topologies can be arranged hierarchically,
with a number of hubs or switches
Bridging
 There is often a need to communicate with
machines that are not attached to the same
network.
• An example might be two campuses that wish to
exchange data. As there are a wide variety of
network technologies the two campuses may not
necessarily have the same type of network
• This means there has to be a method of ‘internetwork’ communication
• Two approaches are used for this purpose: bridges
and routers
o Bridges interconnect similar LANs
o Routers are more general devices capable of interconnecting
a variety of LANs and WANs (wide area networks)
Bridging (2)
 Bridging was developed to join local area networks
LAN A
LAN B
Bridge
S
S
S
S
S
S
 There are a number of reasons for doing this
• Reliability – the bridge joins networks but keeps them physically
separate; a fault on one won’t necessarily affect the other
• Performance – the performance of a broadcast LAN decreases as the
number of machines on the network increases. A number of smaller
LANs will perform better if they are grouped such that intra-network
traffic exceeds inter-network traffic
Bridging (3)
 Reasons (cont.)
• Security – if sensitive traffic can be kept on one
network then the chances of it falling into the wrong
hands are reduced
• Geography – LANs tend to have restricted range. If
an organisation has two geographically separate
LANs it wants to join, then two ‘half-bridges’, joined
by a point to point link can be used
LAN A
S
S
LAN B
S
Half
Bridge
Half
Bridge
S
S
S
Functions of a Bridge
 The bridge reads all frames transmitted on A, and accepts those
addressed to B
 Using the medium access control protocol for B, it retransmits the
frames
 Does the same for the B-to-A direction
Functions of a Bridge (2)
 The bridge makes no modifications to the frames it
receives. It does not add headers or trailers – it simply
copies the relevant frames from one LAN to another
 The bridge should contain some buffer space so it can
store frames in case that the destination LAN is busy
 A bridge may join more than two LANs
 The bridge makes all the LANs appear to be one large
LAN, made up of machines with unique addresses
 The bridge must know what addresses are on what
LANs. There may be a large number of LANs joined by
several bridges, in which case a ‘routing’ decision may
need to be made
Bridge Protocol Architecture
Routing with Bridges
 When a bridge is used to join two LANs, it
makes a very simple routing decision – whether
to forward the frame or not
• This is done by checking the destination address of
the frame against a list of known addresses on the
other LAN, and forwarding in the case of a match
LAN A
LAN B
Bridge
S
S
S
S
S
S
• In the case where the bridge joins more than two
LANs, it must also decide which LAN to forward the
frame to
Routing with Bridges (2)
 However, more complex
topologies can be
implemented using a
number of LANs and
bridges
 In this situation, routing
can still be achieved if
each bridge knows all of
the station addresses that
are on either side of it
 However, there can be
more than one route
between LANs…
Routing with Bridges (3)
 In this situation there is more
than one route between LAN A
and LAN E.
 One method of handling this is
to make each bridge aware of
where all the stations are in the
internet, but this is inefficient
for large networks
 It would be advantageous if the
bridges knew the best route for
a given address and were able
to cope with a changing
topology dynamically
Routing with Bridges (4)
 Routing is easier if the frame’s destination address can
be broken up into two parts – a network address and a
station address
• Eg if a 16 bit number is used to specify the destination address
in the MAC frame, then the first 8 bits can be used to specify
the network the station is on, and the last 8 bits can be used to
specify the station on that network
0xF274
Network ‘F2’
Station ‘74’
• This means that a bridge only has to look at the first byte of the
number, and send the frame to that network
• As LANs are typically ‘broadcast’ in nature, the intended station
will receive the frame as long as it appears on the LAN
Fixed Routing
 A routing table is developed that specifies the route to
use between any two LANs in the internet
Central Routing Directory
Source LAN
A
B
C
D
E
F
G
A
-
101 102 103 107 105 106
B
101 -
C
102 101 -
D
101 103 102 -
E
107 104 102 103 -
F
102 101 105 103 107 -
G
102 101 106 103 107 105 -
102 103 104 105 106
Destination LAN
103 107 105 106
104 105 106
105 106
106
Fixed Routing (2)
 From the central routing table, individual directories can
be stored at each bridge – each bridge needs one table
for each LAN to which it attaches
• The information for each table is derived from a single column
in the central table
Bridge 107 Table
Bridge 104 Table
From LAN B
From LAN E
From LAN A
From LAN E
Dest
Next
Dest
Next
Dest
Next
Dest
Next
A
-
A
-
A
-
A
A
C
-
B
B
C
-
B
-
D
-
C
-
D
-
C
A
E
E
D
B
E
E
D
-
F
-
F
-
F
-
F
A
G
-
G
-
G
-
G
A
Spanning Tree Routing
 Fixed routing is widely used due to its simplicity and
minimal requirements. However, in a complex internet,
where many bridges may be added or removed and
failures must be allowed for, it is limited.
 Spanning tree routing – allows bridges to
automatically develop a routing table and update it in
response to topology changes
• It consists of three mechanisms – frame forwarding, address
learning, and loop resolution
 Frame forwarding – the bridge maintains a database
based on MAC addresses. Each entry consists of a MAC
address, a ‘port’ number, and an ‘aging’ time
Spanning Tree Routing (2)
 The ‘port’ number indicates which LAN to transmit on to
reach the associated MAC address. Every time a frame is
received, the following algorithm is followed
Bridge
forwarding
Forward frame
on all ports
except x
No
Frame received
without error on
port x
DA found in
filtering DB?
Yes
Outbound port
= port x?
Yes
DA = destination address
No
Forward frame
on outbound
port
Spanning Tree Routing (3)
 To add entries to the database the bridge employs a
method known as address learning:
Bridge
learning
Add SA to
database with
direction and
new timer
No
SA found in
filtering DB?
Yes
Update direction
and timer
SA = source address
Finished
 A timer value of 300 seconds is commonly used. When it
expires, the entry is removed. This allows the database
to handle dynamic changes in the network
Spanning Tree Routing (4)
 This method of address learning can lead to ‘loops’ in networks where
there is more than one possible path between LANs
• In the situation below both bridges will see frames from station A on LAN Y,
and erroneously update their tables to indicate that station A is in that
direction
Spanning Tree Routing (5)
 The preceding problem can be avoided by
determining a ‘spanning tree’ for the network
• This is a collection of bridges that connect all LANs in
the internet once only (no closed loops)
• It involves assigning bridges with unique identifiers
and ‘costs’ for each bridge port, so that between
them they can determine a hierarchy that spans the
internet, and ensures that only one bridge will
forward a frame in a given situation
Download