Upload
haxuyen
View
214
Download
1
Embed Size (px)
Citation preview
Unsynchronized Networks
Peter Puschner, Institut für Technische Informatik Wilfried Steiner, TTTech AG
Peter Puschner, TU Wien 2
Ethernet Basics
Peter Puschner, TU Wien
Ethernet Devices • Today we mainly know two Ethernet devices:
– End Stations and Bridges • End stations are also called “end systems” or “end points” or “network interface cards” • Bridges are also called switches
– Note, “bridge” is the correct technical term while “switch” is a marketing brand. – However, as bridge and switch are today mostly used synonymously we use both terms also in this tutorial.
• End stations are connected to bridges through ports and communication links.
End Station 1
End Station 2
End Station 3
End Station 4
Bridge A1
Bridge B1 Bridge B2
Communication LinkMulti-hop Communication Link
Port
CM
SM Synchronization Master
CompressionMaster
SC Synchronization Client
3
Peter Puschner, TU Wien 4
Closer Look at an End Station* • PMC
– PCI Mezzanine Card – Peripheral Component Interconnect
• Data Link Layer – OSI Layer 2 – Media Access Control (MAC) – e.g., IEEE 802.3 Ethernet
• Physical Layer – OSI Layer 3 – e.g., IEEE 802.3, 802.11, 802.15
Media Independent Interface (MII)
*TTTech’s TTEPMC Card
This is the area of this tutorial
Peter Puschner, TU Wien
Ethernet Frame Format
• Some important aspects: – Frames contain address information regarding their source and their destination. – The destination address may be either unicast, multicast, or broadcast. – The 802.1Q header is more prominently known as VLAN tag. – The Payload is between 46 and 1500 octets.
• We will not discuss Jumbo Frames in this tutorial (can discuss in Q/A).
– Ethernet uses a 4 octets CRC called the Frame Check Sequence.
5
Peter Puschner, TU Wien
NIC
SWITCH
NIC
NICNIC
NICSWITCH
NIC
NIC
NIC
NIC
SWITCH
NIC
NIC
X
X
Asynchronous Communication § Transmission Points in Time are not predictable à Transmission Latency and Jitter accumulate à Number of Hops has a significant impact
Ethernet = Unsynchronized Communication
X
6
Peter Puschner, TU Wien 7
Basic Operation • CSMA/CD (Carrier-Sense Multiple-Access / Collision Detection)
– All end stations are connected to a physical bus (no bridges). – In case multiple end stations start to transmit at about the same
point in time – the signals collide on the wire. – End points realize this collision and send a jamming signal. – Retry of transmission after random timeout.
• Switched Ethernet – All end stations are connected to bridges. Bridges can be connected
to each other. – Physical collisions cannot happen any more – but “logical collisions”
remain. – Multiple end stations may send messages to the same receiver. – As the bridge has limited frame buffer, this buffer may overflow and
frames may be lost.
Peter Puschner, TU Wien 8
Operation – Basic Switch
Best Effort
Basic Switch
3 4
2 1
7 8
6 5
Peter Puschner, TU Wien 9
Operation – Basic Switch
Best Effort
Basic Switch
Best-effort frame delivery (standard Ethernet traffic) is NOT guaranteed !
3 6 7 4
5 1 2
8
Peter Puschner, TU Wien 10
Selection of Standards and Solutions
• IEEE 802.3: “Ethernet” • IEEE 802.1Q: “IEEE Standard for Local and metropolitan area networks--Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks”
Peter Puschner, TU Wien 11
Ethernet and Real-Time Communication
Peter Puschner, TU Wien
NIC
SWITCH
NIC
NICNIC
NICSWITCH
NIC
NIC
NIC
NIC
SWITCH
NIC
NIC
X
X
Asynchronous Communication § Transmission Points in Time are not predictable à Transmission Latency and Jitter accumulate à Number of Hops has a significant impact
Ethernet = Unsynchronized Communication
X
12
Peter Puschner, TU Wien
Priorities • Frames with a high priority can overtake frames with a lower priority.
Best Effort
Basic Switch + Priorities
. . .Prio High
Prio Low L1 L2 L3
H1 H2
Best Effort
Basic Switch + Priorities
. . .Prio High
Prio Low L3
H1 H2 L1 L2
Problems with priorities: • High priority frames may “starve” low priority frames. • Too many high priority frames:
à performance of high priority frames becomes insufficient.
13
Peter Puschner, TU Wien 14
Traffic Shaping I: Credit-Based Shaping
frame frame
frame
frame
frame frame frame frame
Class A Queue
Queue with lower priority
Class A Queue transmit allowed
Class A Queue transmit
output port
low credit
high credit
Class A queued frames
t0 t1 t2 t3 t4 t5 t6
Class A credit
t7
t
idle slope
send slope
frame
frame
t8
Peter Puschner, TU Wien 15
Traffic Shaping I: Credit-Based Shaping
• Credit-based shaping is realized in the IEEE 802.1Q Audio/Video Bridging Standard.
• The aim is to guarantee 2ms network latency for SR Class A traffic over seven hops (=six bridges), considering several assumptions, e.g.,
– 100 Mbit/sec network – SR Class A may be sent with a period of 125us – Limited number of AVB streams
• Sum of AVB traffic may not exceed 75% of the port transmit rate. • 75% of 125us = 93.75us • Minimum Ethernet frame size is 6.72us à int(93.75us/6.72us) = 13 frames max. per port
• The credit-based shaper operates on one or many outgoing queues per port in the bridge.
• It guarantees “fairness” properties wrt. lower priority traffic than AVB traffic, i.e., it is guaranteed that bursts of AVB traffic will be interrupted and low priority non-AVB (standard Ethernet) traffic will be served.
Peter Puschner, TU Wien 16
Traffic Shaping I: Rate-Constrained Traffic
Switch/RouterRec
eiver
Sender
Rate-Constrained Traffic (RC)
min. duration min. duration min. duration
Peter Puschner, TU Wien 17
Traffic Shaping I: Rate-Constrained Traffic
• Rate-constrained traffic is implemented in ARINC 664-p7. • It operates on a per stream basis
– in ARINC 664-p7 called Virtual Link (VL) • Strong scientific foundation of latency analysis and several implementations of tools.
– e.g., network calculus, trajectory approach, response-time analysis • Latency is typically calculated as a function of:
– Number, size, and rate of frames – Network topology – Switch model (e.g., switching delay)
• In the process of calculating the latency often the required buffer sizes in the bridges are derived. • à If done right, then it buffer overflows can be excluded and latencies can be guaranteed.
Peter Puschner, TU Wien
AFDX / ARINC 664 AFDX … Avionics Full Duplex Switched Ethernet • Quality of Service
– Bandwidth guarantee – Transmission jitter and latency – Bit Error Ratio (BER)
• Weight • Cost (development, deployment)
builds on ARINC 429, MIL-STD 1553
18
Peter Puschner, TU Wien
AFDX Characteristics • Serial data transfer • Based on Ethernet IEEE802.3 • 10-100 Mbit/s • Medium: copper or optic fiber • Traffic control
– Bandwidth guarantees for Virtual Links
• Reliability – Dual redundancy for each AFDX channel
19
Peter Puschner, TU Wien
AFDX Network Architecture
• two independent redundant networks • at least 20 ports per switch
20
Switch
Switch
End System
End System
End System
End System
Peter Puschner, TU Wien
AFDX System Components
• Each port (ES, switch) consists of Rx and Tx port • Cable contains two twisted-wire pairs
21
AFDX End
System
Partition 1
AFDXSwitch
Controllers
Sensors
Actuators
Partition 2
Partition 3
Avionics Computer System AFDX Network
Avionics Subsystem
Peter Puschner, TU Wien
AFDX Communication Ports • Communication ports
– end points of communication – Supported by OS API
• Sampling Ports – Buffer stores a single message – New message overwrites buffer, non-consuming read
• Queuing Ports – Stores a up to a max. number of messages – FIFO queue
• Operations: send_msg(port_ID, msg), recv_msg(port_ID, msg)
22
Peter Puschner, TU Wien
Virtual Link (VL) • Defines logical communication link • determines frame routing
– Must originate at a single defined End System – Delivers packets to a fixed set of End Systems – Carries messages from one or more comm. ports
• 16-bit Virtual Link ID • Uses Ethernet Destination Address field
23
Constant Field: 32 bits Virtual Link ID 0000 0011 0000 0000 0000 0000 0000 0000 16-bit unsigned integer
Peter Puschner, TU Wien
Virtual Link Scheduling • Traffic shaping by ES’s VL scheduler • VL scheduler multiplexes all VLs of ES • Bandwidth Allocation Gap (BAG)
– Per VL – Defines minimum gap between frames – Range 1-128 ms, power of 2
24
frame frame
BAG BAG
max. jitter max. jitter
Peter Puschner, TU Wien
Sub Virtual Links • VLs regulate flow onto physical link • Sub-VLs regulate flow into VL • VL must be able to handle 4 Sub-VL queues • Sub-VL queues are served in round-robin
25
Peter Puschner, TU Wien
AFDX Frame Structure
or
26
Preamble 7 bytes
IFG 12 bytes
MAC Dest 6 bytes
SFD 1 byte
MAC Src 6 bytes
Type IPv4 2 bytes
FCS 4 bytes
SN 4 bytes
IP Hdr 20 bytes
UDP Hdr 8 bytes
AFDX Payload up to 1471 bytes
Padding 0-16 bytes
Payload 1-17 bytes
Peter Puschner, TU Wien
Reliability Support • Integrity Checking
– Per network and VL – Uses Sequence Numbers (SN) of messages – Sender: consecutive SNs per VL, SN=0 on startup – Receiver accepts:
• SN = 0: reset • SN = SN_old + 1 oder SN = SN_old + 2 • Other frames are discarded
• Redundancy Management – Discard duplicates received from IC – SkewMax determines duplicate-elimination interval
27
Peter Puschner, TU Wien
AFDX Switch • Switching function
– Filtering and policing – Only valid frames are forwarded to right ports – Uses static configuration tables
• Monitoring function – Logs all operations and events – Communicates with Network Management Function
28
Peter Puschner, TU Wien
AFDX Frame Filtering Only valid frames are forwarded • Valid VL identifier • Use VL ID to forward to allowed destination ports • FCS validity • Ethernet frame size alignment • Ethernet frame size range • Adherence to MTU of VL
(MTU … maximum transfer unit, max. number of bytes transmitted in VL frame; Lmax)
29
Peter Puschner, TU Wien
AFDX Traffic Policing Checks adherence to specified limits of bandwidth use • Non-complying traffic is discarded • Byte-based policing
– Checks bandwidth use of VL in bits/s
• Frame-based policing – Checks use of VL in frames/s
30