Summary

This document covers networking concepts, including computer architecture details, and communication protocols like TCP, UDP, and HTTP. It also touches upon routing protocols, and other related topics. It's likely part of a course or study materials on computer networking or related fields.

Full Transcript

RISC v CISC Complex Instruction Set Computer (CISC) ​ Used in early computer architectures ​ Many addressing modes and instructions ​ High code density ​ Often require manual optimization of assembly code for ​ embedded systems Reduced Instruction Set Computer (RISC) ​ Compact, uni...

RISC v CISC Complex Instruction Set Computer (CISC) ​ Used in early computer architectures ​ Many addressing modes and instructions ​ High code density ​ Often require manual optimization of assembly code for ​ embedded systems Reduced Instruction Set Computer (RISC) ​ Compact, uniform instructions facilitate pipelining ​ More lines of code poor memory footprint ​ Allow effective compiler optimization Sockets - ​ process sends/receives messages to/from its socket ​ socket analogous to door ​ sending process shoves message out door ​ sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process Socket programming (example in practice exam) Socket programming with TCP client must contact server server ​ process must first be running ​ server must have created socket (door) that welcomes client’s contact client contacts server by: ​ Creating TCP socket, specifying IP address, port number of server process when client creates socket: ​ client TCP establishes connection to server TCP ​ when contacted by client, server TCP creates new socket for server process to communicate with that particular client ○​ allows server to talk with multiple clients ○​ source port numbers used to distinguish clients TCP provides reliable, in-order byte-stream transfer (“pipe”) between client and server Routing protocol goal: ​ determine “good” path (equivalently, routes), from sending hosts to receiving host, through network of routers ​ path: sequence of routers packets will traverse in going from given initial source host to given final destination host ​ “good”: least “cost”, “fastest”, “least congested” ​ routing: a “top-10” networking challenge! HTTP connections ​ non-persistent HTTP ○​ at most one object sent over TCP connection ​ connection then closed ○​ downloading multiple objects required multiple connections ○​ persistent HTTP ​ multiple objects can be sent over single TCP connection between client, server Non-persistent HTTP: response time ​ RTT (definition): time for a small packet to travel from client to server and back ​ non-persistent HTTP response time = 2RTT+ file transmission time Persistent HTTP: non-persistent HTTP issues: ​ requires 2 RTTs per object ​ OS overhead for each TCP connection ​ browsers often open parallel TCP connections to fetch referenced objects persistent HTTP: ​ server leaves connection open after sending response ​ subsequent HTTP messages between same client/server sent over open connection ​ client sends requests as soon as it encounters a referenced object ​ Response time = as little as one RTT for all the referenced objects Transport vs. network layer ​ network layer: logical communication between hosts ​ transport layer: logical communication between processes ○​ relies on, enhances, network layer services ​ Anaology: ○​ 12 kids in Ann’s house sending letters to 12 kids in Bill’ s house: ○​ hosts = houses ○​ processes = kids ○​ app messages = letters in envelopes ○​ transport protocol = Ann and Bill who demux to in- house siblings ○​ network-layer protocol = postal service MAC protocols: taxonomy three broad classes: ​ channel partitioning: ○​ divide channel into smaller “pieces” (time slots, frequency, code) ○​ allocate piece to node for exclusive use ​ random access ○​ channel not divided, allow collisions ○​ “ recover ” from collisions ​ “taking turns” ○​ nodes take turns, but nodes with more to send can take longer turns TDMA: time division multiple access ​ access to channel in "rounds" ​ each station gets fixed length slot (length = packet transmission time) in each round ​ unused slots go idle ​ example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle FDMA: frequency division multiple access ​ channel spectrum divided into frequency bands ​ each station assigned fixed frequency band ​ unused transmission time in frequency bands go idle ​ example: 6-station LAN, 1,3,4 have packet to send, frequency bands 2,5,6 idle Slotted ALOHA assumptions: ​ all frames same size ​ time divided into equal size slots (time to transmit 1 frame) ​ nodes start to transmit only slot beginning ​ nodes are synchronized ​ if 2 or more nodes transmit in slot, all nodes detect collision operation: ​ when node obtains fresh frame, transmits in next slot ○​ if no collision: node can send new frame in next slot​ ○​ if collision: node retransmits frame in each subsequent slot with prob. p until success\ Switches vs. routers ​ both are store-and-forward: ○​ routers: network-layer devices (examine network layer headers) ○​ switches: link-layer devices (examine link-layer headers) ​ both have forwarding tables: ○​ routers: compute tables using routing algorithms, IP addresses ○​ switches: learn forwarding table using flooding, learning, MAC addresses Elements of a wireless network ​ wireless hosts ○​ laptop, smartphone ○​ run applications ○​ may be stationary (nonmobile) or mobile ​ base station ○​ typically connected to wired network ○​ relay - responsible for sending packets between wired network and wireless host(s) in its “area” ​ wireless link ○​ typically used to connect mobile(s) to base station ○​ also used as backbone link ○​ multiple access protocol coordinates link access ○​ various data rates, transmission distance ​ infrastructure mode ○​ base station connects mobiles into wired network ○​ handoff: mobile changes base station providing connection into wired network ​ ad hoc mode ○​ no base stations ○​ nodes can only transmit to other nodes within link coverage ○​ nodes organize themselves into a network: route among themselves Passive/active scanning ​ passive scanning: ○​ (1) beacon frames sent from APs ○​ (2) association Request frame sent: H1 to selected AP ○​ (3) association Response frame sent from selected AP to H1 AP 2 AP 1 H1 BBS 1 BBS 2 1 2 2 3 4 ​ active scanning: ○​ (1) Probe Request frame broadcast from H1 ○​ (2) Probe Response frames sent from APs ○​ (3) Association Request frame sent: H1 to selected AP ○​ (4) Association Response frame sent from selected AP to H1 Priorities and Vectors ​ Need to handle interrupts from multiple devices ​ Two mechanisms allow us to make interrupts more general: ○​ Priorities determine what interrupt gets CPU first. ○​ Vectors determine what code is called for each type of interrupt. ​ Mechanisms are orthogonal: most CPUs provide both. Interrupts ​ Some interrupts are more important ​ Lower-numbered interrupt lines have higher priority ​ Re-connect lines to change priorities ​ Masking: interrupt with priority lower than current priority is not recognized until current interrupt is complete. ​ Highest-priority is non-maskable interrupt (NMI) which is never masked. Timers and Counters ​ Very similar: ○​ a timer is incremented by a periodic signal; ○​ a counter is incremented by an asynchronous, occasional signal. ​ Timeout or rollover causes interrupt. ​ Timer updates as time passes ​ Counter is conditional Watchdog Timer ​ An I/O device used to detect and recover from system malfunctions. ​ Watchdog timer is periodically reset by the system timer. ​ If watchdog is not reset, its timeout generates an interrupt to reset the host. ○​ Presumption: CPU is misbehaving so that watchdog is not reset Inter-integrated Circuit (I2C or I2C) ​ Two-wire interface Simple master/slave relationships ​ No strict baud requirement and a master generates a bus clock ​ Each device is software-addressable by a unique address ​ Philips semiconductors (now NXP) I2C Terminology: ​ Master: sends out signals (clock signal and communication signal) to slaves ​ Slave: listensto the bus and waitsto be addressed by master ​ Multi-master: I2C allows connections of multiple masters ​ Arbitration: decides which master to use wire MORE IN THE SLIDES (bus1) Serial Peripheral Interface (SPI) ​ Serial protocol ​ Peripheral connections in embedded system ○​ Microcontroller EEPROMs ​ Quick communication over short distance ​ Motorola ​ Basic Model ○​ ○​ Serial Click (SCLK or SCK): clock pulse that synchronizes data transmission generated by master ○​ Master Out Slave In (MOSI): master line for sending data to peripherals. ○​ Master In Slave Out (MISO):slave line for sending data to master ○​ Slave Select(SS): pin on which device the master could use to enable/disable specific devices MORE IN THE SLIDES (Bus 2) SPI v I2C ​ I2C require two wires while SPI may need more ​ SPI support full-duplex communication while I2C is slower ​ I2C is more power-consuming than SPI ​ I2C has ACK to verify data transfer while SPI is not ​ I2C may have multiple master but SPI only has one master ​ SPI ○​ high speed and low consumption application ○​ faster ​ I2C ○​ large number of peripheral requirement and multiple masters ○​ flexible ​ But both are synchronous serial protocols for embedded applications Real-Time Hard deadline: ​ violating timing constraints causes failure ○​ Anti-lock Brake System (ABS) ○​ CD burner ○​ Homework/Labs submission Soft real time: ​ missing deadline results in degraded performance ○​ Video ○​ GPS map ○​ Homework/Labs grading Von Neumann vs. Harvard ​ von Neumann ○​ Same memory holds both data and instructions. ○​ A single set of address/data buses between CPU and memory ​ Harvard ○​ Separate memories for data and instructions. ○​ Two sets of address/data buses between CPU and memory ○​ On chip cache of CPUs is divided into an instruction cache and a data cache TCP (transmission control protocol) v UDP (user datagram protocol) ​ Connection: TCP is connection-based, while UDP is connectionless. ​ Reliability: TCP is more reliable than UDP. ​ Speed: UDP is faster than TCP. ​ Data integrity: TCP only transmits complete sets of data packets, while UDP transmits whatever it can. ​ Security: TCP transmissions are generally easier to keep secure than those sent via UDP. ​ Data order: TCP sends data in a particular sequence, whereas there is no fixed order for UDP. ​ Congestion: TCP implements congestion avoidance algorithms, whereas UDP does not control congestion. ​ Use cases: TCP is more suitable for scenarios where data reliability is crucial, while UDP is better for scenarios where low latency and speed are key. Multiplexing v demultiplexing ​ multiplexing at sender: ○​ handle data from multiple demultiplexing at receiver: sockets, add transport header (later used for demultiplexing) ​ demultiplexing at receiver: ○​ use header info to deliver received segments to correct socket Parallel I/O v Serial I/O ​ Parallel I/O: multiple input/output simultaneously ○​ Data Bus, Address Bus, Intel 8255, printer ​ Serial I/O: transferring data between CPU and peripherals one bit at a time,sequentially ○​ Ethernet, USB, Inter-integrated Circuit, Serial Peripheral Interface ​ Parallel ○​ Wider bandwidth ○​ More wires indicate more overhead ○​ Simple I/O operation ​ Serial ○​ 1-bit transfer per time unit ○​ Less wires indicate less overhead ○​ Complex I/O protocol Synchronous vs. Asynchronous Communication ​ All digital communication requires a clock signal (the transmitter uses the clock to decide when to transmit the next bit and the receiver uses the clock to decide when to read/sample the next bit) ​ In synchronous communication standards such as SPI and I2C, the clock signal is sent on a separate wire along with the data. ○​ The device that generates the clock is called the Master and the other device is called the Slave ​ In asynchronous communication, there is no clock signal sent. The receiver has a separate clock that it usually derives using some additional information in the data line (called clock & data recovery) ​ Can use two data wires and have data travel in both directions simultaneously (full-duplex) or use a single wire and have data travel only in one direction at a time (half-duplex) Simplex vs. Half-duplex vs. Full-duplex transmission ​ Simplex mode, ○​ Sender can send the data but that sender can't receive the data. ​ Half Duplex mode, ○​ Sender can send the data and also can receive the data but one at a time. ​ Full Duplex mode, ○​ Sender can send the data and also can receive the data simultaneously. Usage of one channel for the transmission of data.

Use Quizgecko on...
Browser
Browser