1-3-IO
1-3-IO
Even Faster…
• PCI Express used for variety of devices:
– Most graphics cards
– external GPUs
– wifi interfaces
– video capture
– SSDs
– RAID controllers
– Parallel cluster
interconnects
– Etc…
Interrupt-Driven I/O
• Processor is interrupted when I/O
module is ready to exchange data
• Processor is free to do other work
• No needless waiting
• Consumes a lot of processor time
because every word read or written
passes through the processor
.
.
.
Kernel
Network Interface
• Of course, a major type of I/O in modern computers
(laptops, desktops, smart phones, etc.) is the
network interface.
• Perspective: for a few decades, networking was
NOT an integral part of a computer
(processor, memory, disk, keyboard, terminal)
• Now, the network enables access to the WWW,
streaming services, etc., etc..
• But the (hidden) network also extends the basic
functionality of computing into the Internet.
• More on this later…
CSE 325 Architecture
Computer Network Terminology
• As mentioned the first day of class,
– computer network functionality is organized as a set of
layers
– Each layer has specific duties with regard to delivering
data across the Internet.
– In the Internet, all data (files, video, images, form data) is
transmitted in “chunks” collectively called packets
• Interestingly, packets are referred to by different
names at different layers:
– frames, datagrams, segments, messages...
Physical Networks
(physical addresses)
Illustration
Physical Networks
(physical addresses)
Illustration
Internetwork
(IP addresses)
Physical Networks
(physical addresses)
Illustration
Transport Service
(IP address, port #)
Internetwork
(IP addresses)
Physical Networks
(physical addresses)
Illustration
Application Protocol
(e.g., web client/server)
What Network?
Transport Service
(IP address, port #)
Internetwork
(IP addresses)
Physical Networks
(physical addresses)
Network Architecture
• A set of layers and protocols
• Layers correspond to layers in previous slides
• Layer interaction
– each layer offers primitive operations and services to higher layers
– interfaces must be be clean and well-defined
• Layers (bottom to top)
1. Physical: how to transmit bits on a wired or wireless channel
2. Link: support communication between directly connected nodes
3. Network: enable communication across a network
(route packets, forward them from one node to the next)
4. Transport: enable process-to-process communication
5. Application: Everything above the transport layer
Application
Transport
Network
Link
Physical
55
datagram datagram
controller controller
frame
Errors in communication
• Examples sources of errors
– interference from electrical equipment
– impulse noise: e.g., lightning
– signal distortion
– sender, receiver losing synchronization
– “collisions” between frames on a shared channel
• Even a single bit error can cause major
damage. Why?
Example
But, how to know if a packet is damaged?
• A key function implemented in hardware/firmware
by the link layer:
• Error detection
– the network interface receiving a frame needs to detect if
any bits have been flipped
– sender computes and attaches a checksum to the frame
– receiver recomputes the checksum upon arrival
• match, ok. no match, drop frame and request retransmission.
• at link layer, retransmit a limited number of times, then give up.
• TCP can provide full reliability IF desired
• Note: some types of communication do not require
100% reliability 69
CSE 325 Architecture
72
Cyclic Redundancy Codes (CRC)
• Basic idea: treat string of bits as coefficients of
polynomials over GF(2).
• Ex. 101001 represents x5 + x3 +1
• Addition and subtraction are both equivalent to
exclusive-or
• 10011011 10011011
• +11001010 -11001010
Example:
74
Example:
• Division of polynomials over GF(2)
75
• CRC-32
x32 + x26 + x23 + x22 + x16 + x12 + x11 +x10 + x8 + x7 + x5 +
x4 + x2 + x +1
detects 99.99999997% of all burst errors of length 34
or more.
• CRC-64-ISO
x64 + x4 + x3 + x + 1
• CRC-64-ECMA-182
x64 + x62 + x57 + x55 + x54 + x53 + x52 + x47 + x46
+ x45 + x40 + x39 + x38 + x37 + x35 + x33 + x32 +
x31 + x29 + x27 + x24 + x23 + x22 + x21 + x19 + x17
+ x13 + x12 + x10 + x9 + x7 + x4 + x + 1
CSE 325 Architecture
CRC Summary
• Basic idea:
– divide a relatively short number into a long frame
– subtract remainder
– divide as frame arrives, check for 0 remainder.
• Extremely effective in detecting errors!
• And due to implementation in hardware as data is
transmitted and received, overhead is essentially 0!
• Wow!
Architecture Summary
• The system architecture enables the execution of
computer programs
• But in ways beyond simply
– executing instructions
– reading and writing memory
• Examples:
– Interrupts guide the entire execution of the system
• interaction with peripheral devices
• clock interrupt for time slicing
• exceptions
• system calls
• ....
Architecture Summary (cont.)
– Execution mode:
• user mode – limits access to hardware by applications
• kernel mode – provides OS direct access the hardware
– Cache memory
• exploit locality to greatly improve performance
– Virtual memory - page tables set up by OS, but...
• architecture walks page tables (fast compared to OS!)
• takes actions (e.g., exception) based on control bits in PTE
• TLB cache of PTEs makes it even faster!
– High-speed connections to wide variety of chip sets and
peripherals, including high-speed graphics, networking
– DMA (CPU can do other work while transfer takes place)
– and finally, CRC, near zero-cost, powerful, error detection