Download presentation
Presentation is loading. Please wait.
Published byEdward Reed Modified over 9 years ago
1
CS470 Computer Networking Protocols Huiping Guo Department of Computer Science California State University, Los Angeles 2. Ethernet
2
Outline r Overview of data link layer r Overview of LANs r Ethernet r Extended LANs 2-2 2. ethernet CS470_W12
3
Data link layer overview Network layer Link layer Physical layer Network layer Link layer Physical layer Data frame 11001010… Transport layer Application layer Transport layer Data H H H H H T H H H H datagram segment Data H H H T H H H Note: segment, datagram and frame are also called packet 2-3 2. ethernet CS470_W12
4
Data link layer overview (cont.) r Achieve reliable, efficient communication between two physically connected (?) machines r Make use of services provided by the physical layer m Get a series of bits r Provide services to the network layer m The kind of services depends on the link layer protocol 2-4 2. ethernet CS470_W12
5
Design issues r Services interface to the network layer r How to group bits into frames (framing) r How to deal with errors (error control) m Errors in the physical layer r How to make a link appear reliable m A link may corrupts frame from time to time r How to mediate access to a link if the link is shared by multiple hosts 2-5 2. ethernet CS470_W12
6
Outline r Overview of data link layer r Overview of LANs r Ethernet r Extended LANs 2-6 2. ethernet CS470_W12
7
Point-to-Point communication r Each communication channel connects exactly two computers 2-7 2. ethernet CS470_W12
8
Point-to-Point communication (cont.) r Disadvantages: m The number of connections grows quickly as the size of the network increases m The number of connections needed for N computers is proportional to N 2 Direct connections required = (N 2 -N)/2 m The expense is especially high 2-8 2. ethernet CS470_W12
9
Shared communication channels r Local Area Networks m Devised as alternatives to expensive, dedicated point-to- point connections. r Rely on the shared medium m A set of computers attach to a cable m The computers take turns sending data r Sharing reduces cost! 2-9 2. ethernet CS470_W12
10
Comparison r Networks based on the shared medium m Used for LOCAL communication. r Point-to-point connections m Used for long-distance networks m Why not shared medium? 2-10 2. ethernet CS470_W12
11
Shared medium not suitable for long distance networks r Computers attached to a shared network must coordinate use of the network r Coordination requires communication, introduces longer delays r Shared networks with long delays are inefficient m they spend more time coordinating the use of the shared medium and less time sending data 2-11 2. ethernet CS470_W12
12
LANs are popular r LANs are the most popular form of computer network r They are relatively cheap r They are typically fast r Deployed today in not just workplace and offices, but also in the home 2-12 2. ethernet CS470_W12
13
Features r Limited to short distance r Rely on shared media r Topologies r Many LAN technologies exist m Determined by the link layer protocol 2-13 2. ethernet CS470_W12
14
Network Topology r Specify general “shape” of a network r Often applied to LAN r LAN Topologies m Bus m Star m Ring 2-14 2. ethernet CS470_W12
15
Star topology r All computers attach to a central point. hub or switch 2-15 2. ethernet CS470_W12
16
Bus topology r The computers are attached to a single, long cable (bus) r Any attached computer can send a signal down the cable and all computers receive the signal. 2-16 2. ethernet CS470_W12
17
Ring topology r All computers are connected in a closed loop r The ring refers to logical connection, not physical connection r Data flow in one direction 2-17 2. ethernet CS470_W12
18
Choice of Topology r Reliability r Expandability r Performance r Needs considering in context of: m Medium m Wiring layout m Access control 2-18 2. ethernet CS470_W12
19
Outline r Overview of data link layer r Overview of LANs r Ethernet r Extended LANs 2-19 2. ethernet CS470_W12
20
Ethernet r First widely used LAN technology r “dominant” wired LAN technology: r Ethernet uses bus topologies r Simpler and cheaper r Kept up with speed race: 10 Mbps – 10 Gbps 2-20 2. ethernet CS470_W12
21
Shared medium in a LAN r Shared medium used for all transmissions r Only one station transmits at any time r Stations “take turns” using medium r Media Access Control (MAC) policy ensures fairness 2-21 2. ethernet CS470_W12
22
Illustration Of Ethernet Transmission r Only one station transmits at any time r Signal propagates across entire cable r All stations receive transmission r CSMA/CD media access scheme 2-22 2. ethernet CS470_W12
23
CSMA/CD Paradigm r Multiple Access (MA) m Multiple computers attach to shared media m Each uses same access algorithm r Carrier Sense (CS) m Wait until medium idle m Begin to transmit frame r CSMA plus Collision Detection (CD) m Listen to medium during transmission m Detect whether another station’s signal interferes 2-23 2. ethernet CS470_W12
24
Transmitter algorithm r When a station has a frame to send and the line is idle, it transmits the frame immediately m There is no negotiation with other stations r busy, it waits for the line to go idle and then transmits immediately r Collisions m Two stations find the line idle and transmit at the same time m While a station on one end starts to transmit a frame, the other station one the opposite end doesn’t sense the line busy and transmits 2-24 2. ethernet CS470_W12
25
Transmitter algorithm r While a station is transmitting, it keeps listing to the line m If there is a collision, the station stops transmission and sends a jam signal m Back off from the interference and try again 2-25 2. ethernet CS470_W12
26
Addressing: Identifying A Destination r A pair of computers communicate across a LAN r All other computer in the LAN receive and process each copy of the message r How to avoid this? 2-26 2. ethernet CS470_W12
27
Addressing: Identifying A Destination (cont.) r Allow sender to specify destination m Each station assigned unique 48-bit address: MAC address m Address assigned when network interface card (NIC) or network adapter manufactured m Each frame contains address of intended recipient 2-27 2. ethernet CS470_W12
28
Ethernet Address Recognition 2-28 2. ethernet CS470_W12
29
Broadcast On Ethernet r All 1s address specifies broadcast r Sender m Places broadcast address in frame m Transmits one copy on shared network m All stations receive copy r Receiver always accepts frame that contains m Station’s address m The broadcast address 2-29 2. ethernet CS470_W12
30
Frame header and frame format r Each LAN defines the exact frame format used with the technology r General format: m Frame header+DATA m All frames with the same LAN technology have the same header size 2-30 2. ethernet CS470_W12
31
Ethernet Frame Structure Preamble: r 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 r used for synchronization 8 6 6 24 2-31 2. ethernet CS470_W12
32
Ethernet Frame Structure (more) r Addresses: 6 bytes m if adapter receives frame with matching destination address, or with broadcast address it passes data in frame to net-layer protocol m otherwise, adapter discards frame r Type : indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk) r CRC: error detection 2-32 2. ethernet CS470_W12
33
Network Interface Card r The interface between your computer and the LAN r Also called network adapter r Implements Data link layer and part of physical layer 2-33 2. ethernet CS470_W12
34
Outline r Overview of data link layer r Overview of LANs r Ethernet r Extended LANs 2-34 2. ethernet CS470_W12
35
LAN Distance Limitations r LANs use shared medium - Ethernet r Why limit the length of LANs m Fare Access CSMA/CD –with minimum frame size, if propagation delay too long we won’t detect collision while transmitting m Hardware is engineered to emit a fixed amount of electrical power An electrical signal gradually becomes weaker as it travels along a copper wire. r Can extend distances m Repeaters/Hubs m Bridges/Switches 2-35 2. ethernet CS470_W12
36
Repeaters r A bidirectional, analog amplifier that retransmits analog signals m Simply copy signals between segments m Do not understand frame formats or addresses Act on bits r One repeater can effectively double the length of an LAN segment, e.g. 100m to 200m 2-36 2. ethernet CS470_W12
37
Hubs r Hubs act as repeaters r Connect multiple LAN segments hub 2-37 2. ethernet CS470_W12
38
Limits on Repeaters/Hubs r Can't extend Ethernet with repeaters indefinitely m At most 4 repeaters r CSMA/CD requires low delay m if medium is too long, CSMA/CD won't work m Run into the problem of not being able to detect collisions while transmitting the frame 2-38 2. ethernet CS470_W12
39
Limits on Repeaters/Hubs r Repeaters/Hubs don’t understand frames m Don’t distinguish between signals that correspond to a valid frame and other electrical signals m If a collision or electrical interference occurs on one segment, repeaters cause the same problem to occur on all other segments r Even two computers are in the different LAN segments, they cannot transmit at the same time r Aside from hubs, bridges are used today in favor of repeaters 2-39 2. ethernet CS470_W12
40
Bridges r A device that connects two LANs r Act on frames 1) List to traffic on each segment 2) When it receives a frame from LAN1, it checks the destination address In LAN1? Discard! In LAN2? Go to 3) 3) The frame arrived intact? mYes! Forward it to LAN2 mNo! discard 2-40 2. ethernet CS470_W12
41
Bridge Operation 2-41 2. ethernet CS470_W12
42
Advantages of Bridges r They help isolate problems m Don’t forward interference signals in one segment to another m Don’t forward collisions from one segment to another m Only forward complete and correct frames 2-42 2. ethernet CS470_W12
43
Frame filtering r A bridge doesn’t forward a frame unless necessary r How to determine whether to forward a frame? m A bridge receives a frame from LAN1 m Checks the destination address m If the destination address is in LAN1, discard the frame m If not, forward the frame on the other segment 2-43 2. ethernet CS470_W12
44
Frame filtering (cont.) r How does a bridge know which computers are attached to which segment? r Adaptive learning m Bridges can learn automatically m No configurations required 2-44 2. ethernet CS470_W12
45
Bridge Learning Algorithm r Receive some data packet on some input port r Look at the packet’s source MAC address. If it’s not a broadcast address then: m Lookup address in internal lookup table m If not in the table, store it in the table using the address and the port it is on m If it is in the table, change the entry if it’s on a different port 2-45 2. ethernet CS470_W12
46
Bridge Operation Example 2-46 2. ethernet CS470_W12
47
Exercise r Four LANs are connected by three bridges. Each bridge maintains two tables which describe what stations are in each LAN. r Initially, all the tables are empty. 2-47 2. ethernet CS470_W12
48
Exercise r Show how the tables of the three bridges change after each of the following events happen in sequence. 1. A sends a frame to B 2. A sends a frame to F 3. F sends a frame to A 4. E sends a frame to I 5. G sends a frame to H 6. H sends a BROADCAST frame. 7. D sends a frame to G 8. G sends a frame to D 9. H sends a frame to C 10. A moves to LAN3 and then sends a frame to B 2-48 2. ethernet CS470_W12
49
BG1BG2BG3 L1L2 L3L2L4 1A->BAAA 2A->FAAA 3F->AAFAFA, F 4E->IAF, EA A,F, E 5G->HAF,E, GA,GF,EA,F, EG 6H BRAF,E,G,HA,G, H F,EA,F, EG, H 7D->GAF,E,G,H, D A,G, H,D F,EA, F, E,D G,H 8G->DAF,E,G,H, D A,G, H,D F,EA, F, E,D, G,H 9H->CAF,E,G,H, D A,G, H,D F,EA,F, E,D G,H 10A->L3 A->B E,G,H,D, A G,H, D F,E A A,F, E,D G,H 2-49 2. ethernet CS470_W12
50
Multiple LANs 2-50 2. ethernet CS470_W12
51
Multiple Bridges r Anything wrong with this picture? 2-51 2. ethernet CS470_W12
52
A cycle of bridges r Bridged LANs contain a loop and all bridges forward broadcast frames m frames flow around the cycle forever m Computers on all segments receive an infinite number of copies r How to prevent this? m A bridged network must NOT allow both of the following conditions to occur simultaneously All bridges forward all frames The bridged network contain a cycle of bridged segments. 2-52 2. ethernet CS470_W12
53
A cycle of bridges r A network is managed by more than one administrator m In such a setting, it is possible that no single person knows the entire configuration of the network m A bridge that closes a loop might be added without anyone knowing r Loops are built into the network on purpose m Redundancy is provided to make the network more immune o failure r Bridges must be able to handle loops m Run a distributed spanning tree algorithm 2-53 2. ethernet CS470_W12
54
Switches r Switches are similar to bridges m They both operate at the link layer m They both know frame addresses m The two terms are often used interchangeably r Most switches act just like a bridge m Segments traffic m Typically implements spanning tree algorithm m Has more ports than a bridge 2-54 2. ethernet CS470_W12
55
Combining switches and hubs 2-55 2. ethernet CS470_W12
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.