Cheat Sheet - P
Cheat Sheet - P
If you send some information all other nodes in the communication channel can hear that information. But in Wired
networks we need a cable between each pair of devices. Ad hoc network topology is weird, random and dynamic. There can be reflections from environment, multipath effects and interference which affects link quality unpredictably. This affects link
throughput. In wired networks links are independent. Limited battery, No infrastructure. Proactive routing protocols maintain routes independently of the need for communication. The packet delivery latency can be low because the routing information
is always available. But the network bandwidth may get wasted due to periodic route updates (for nearby node). On‐demand routing protocols discover a route only when there are data to send. they can save node energy and network bandwidth when
there is no or little data traffic. The route discovery may also introduce significant delay for the first packet of a new transfer (for far nodes). DSDV Exchange of routing tables -destination+cost. Each node advertises its presence and tables. Maintains
fresh routes by periodically sending updates to neighbors. Update hop count, sequence number. sequence no. to avoid loops. Increment sequence no. for each update. Keep the simplicity of Distance Vector. Guarantee Loop Freeness. Make immediate
route advertisement on significant changes in routing table. wait with advertising of unstable routes. DSDV Advertisements Advertise to each neighbor own routing info. Destination increases its own destination sequence no. on each advertisement
(even no).Intermediate nodes: If a node is no longer reachable increase sequence no of this node by 1 (odd sequence no) and set metric ∞. DSDV Route Selection Info in advertisements is compared to content of routing table. Select route with higher
destination sequence no. Select route with better metric when sequence no are equal. Routing metrics can be path length in hops or metrics that capture link quality. Stability info can be used to avoid rapid fluctuations in routing tables. DSR routing On-
demand route discovery. Avoid the overhead of periodic route advertisements. Source routing: path info is stored in packet header by sender. Intermediate nodes can have out of date info. DSR Route Discovery route-request (includes path) from source
to destination. Each node forwards the request by adding own address to path and re-broadcasting. Requests propagate outward until destination is found, or A node that has a route to destination is found. Forwarding Route Requests A request is
forwarded by a node if: Node is not the destination. Node not already listed in recorded source route. Node has not seen request with same sequence no. Destination copies selected route into Route-reply packet and sends it back to Source . Route Cache
All source routes learnt kept in cache. If an intermediate node receives route request for a destination and has an entry for the destination in its route cache, it responds to request and does not propagate it further. Nodes overhearing route requests and
replies may insert routes in their cache. Greedy Perimeter Stateless Routing Use positions of neighboring nodes and packet destination to forward packets. Greedy forwarding. Perimeter forwarding. Packet delivery ratio is link metric to indicate link
quality. Wireless links can be very different and their performance can change unpredictably. PDR is a better solution to measure link quality. PDR considers packet loss, it does not consider link data rate. ETX: Minimize Number of Transmissions
which measures each link’s packet delivery probability with broadcast probes. It considers some factors such as bit rate, short probes under-estimate loss rate, traffic load, hidden terminals. ETT: Expected Transmission Time ETT = ETX / Link rate= 1 /
(P(delivery) * Bit Rate).
Note 8 Piconet is the basic unit of Bluetooth Networking and it consists of a master and 1-7 active slave devices. Master radio determines the channel and phase (timing offset i.e., when to transmit) and all devices on this piconet. The logical channel and
data transfer are shared by a piconet. Scatternet A device in one piconet may exist as part of another piconet and may function as either a slave or master in each piconet. The advantage of scatternet is it allows many devices to share the same physical
area and makes efficient use of bandwidth. Frequency Hopping FH occurs by jumping from one channel to another in pseudorandom sequence. Hopping sequence shared with all devices on piconet. Physical Links between Master and Slave
Synchronous connection oriented (SCO): Allocates a fixed bandwidth between a point-to-point connection involving the master and a single slave. The master uses reserved slots at regular intervals for maintaining the SCO link. The link is considered
symmetric as basic unit of reservation is two consecutive slots (one in each transmission direction). The master can support up to three simultaneous SCO links while a slave can support three SCO links to a single master or two SCO links to different
masters. SCO packets are never retransmitted. Asynchronous connectionless (ACL) Point-to-multipoint link between master and all slaves. Only single ACL link can exist. Extended Synchronous connection oriented (eSCO):Reserves slots just like
SCO. these can be asymmetric. Retransmissions are supported. Bluetooth Packet Fields: Access code, header, payload. Channel access code Channel access code (CAC) – identifies a piconet, Device access code (DAC) – for paging and subsequent
responses and Inquiry access code (IAC) – for inquiry. Link Manager Manages various aspects of the radio link between a master and a slave. Involves the exchange LMP PDUs. L2CAP: Relies on lower layer for flow and error control. Makes use of
ACL links, does not support SCO links. Provides two alternative services to upper-layer protocols-Connectionless service (unidirectional) and Connection-oriented service (bidirectional). Zigbee Low data rate, long battery life, secure networking. Quick
wake from sleep. four main components: Network layer provides routing. Application support sublayer supports specialized services. ZigBee device objects (ZDOs) are the most significant improvement. They keep device roles, manage requests to join
the network, discover devices, and manage security. Manufacturer-defined application objects allow customization. ZigBee Coordinator Creates, controls, and maintains the network. Only one coordinator in the network. Maintains network information,
such as security keys. ZigBee Router Can pass data to other ZigBee devices. ZigBee End Device Only enough functionality to talk to a router or coordinator. Cannot relay information. Sleeps most of the time. Less expensive.
Note 7 Packets have multi-rate format why? 802.11 allows multirate based on channel conditions. Device has to be synchronized first. Synchronization part the data should be transmitted at lower rate. After that the data can be transmitted at higher
rate. Long preamble (144 bits) is transmitted at lower rate 1Mbps bcz it is easier to decode. Payload is transmitted at variable rate. Short preamble (72 bits) different parts of frame is transmitted at different rates. Forwarding Logic node needs to send IP
packet: in the same IP network? (Check destination IP address) – Yes, forward based on MAC address. Use ARP for mapping from IP to MAC. No- forward packet to gateway router. Use MAC address of the router. Case1 Communication Inside BSS
AP knows which stations are registered with it so it knows when it can send frame directly to the destination. Case2 AD Hoc Direct transmit only in IBSS (Independent BSS), without AP. Case3 To the Internet MAC A determines IP address of the
server. From the IP address, it determines that server is in a different subnet. Hence it sets MAC R as DA. AP will look at the DA address and send it on the Ethernet. Router R will relay it to server. Case 4: From Internet to Station Packet arrives at
router R – uses ARP to resolve destination IP address. MAC A host replies with its MAC address. Router sends data packet, which the AP simply forwards because it knows that MAC A is registered. SSID Each AP is programmed with a SSID that
corresponds to its network. Client computer presents correct SSID to access AP. Association Management Stations must associate with an AP before they can use the wireless network. Association is initiated by the wireless host. Step: Scanning:
finding out what access points are available. Selection: deciding what AP (or ESS) to use. Association: protocol to “sign up” with AP – involves exchange of parameters. Authentication: needed to gain access to secure APs. Scanning: Passive
scanning: station simply listens for beacon and gets info of the BSS. Time consuming. Active scanning: station transmits Probe Request; elicits Probe Response from AP. Selection: wireless host selects the AP it will use in an ESS based on vendor-
specific algorithm and info got from scan. joins the AP with the strongest signal. Associating with an AP. Synchronization in Timestamp Field and frequency. Roaming: Reassociation: association is transferred from active AP to a new target AP (in
same ESS). Reassociation based on vendor specific algo. Association Request Frame sent to the new AP. New AP accepts or rejects the request using an Association Response Frame. Coordination between APs: Allows forwarding of frames in multi-
vendor networks. Inter-AP authentication and discovery using RADIUS server. Reassociation Algorithms: Failure driven: only try to reassociate after connection to current AP is lost. Proactive reassociation: periodically try to find an AP with a
stronger signal. WLAN Security Exploits: Insertion attacks: unauthorized Clients or AP. Interception and unauthorized monitoring: Packet Analysis by “sniffing”. Brute Force attacks against AP passwords-Dictionary Attacks Against SSID.
Encryption attacks: Exploit known weaknesses of WEP. Misconfigurations, e.g., use default password. Jamming – denial of service. MAC filtering: Each AP can be programmed with the set of MAC addresses it accepts (white list). Combine this
filtering with the AP’s SSID. Solution: Some overhead to maintain list of MAC addresses. forge MAC addresses: Unauthorized client can borrow the MAC address. Built-in firewall of impersonated clients will discard unexpected packets. WEP: key
could be cracked with a couple of hours of computing. Clever optimizations can reduce time to minutes. No protocol for encryption key distribution. All data then becomes vulnerable to interception. CRC32 check is also vulnerable. Port-based
Authentication: Users get a username/password to access AP. WPA: Uses a different Message Integrity Check. Encryption based on RC4 and keys are changed periodically. frame counter in MIC to prevent replay attacks. Can be used with 802.1x
authentication- generates a long WPA key that is randomly generated, uniquely assigned and frequently changed. Attacks are still possible bcz using short, poorly random WPA keys that can be cracked. 802.11i is a permanent security fix: Replaces RC4
by AES. Better key management and data integrity. Authentication in WLAN Hotspots: upon association with AP authentication traffic can pass through. Protocol used EAP.
Note 6 Framing: encapsulating a packet into a bit stream. Logical link control: managing the transfer between the sender and receiver. Media access: controlling which device gets to send a frame next over a link. Error Control: Error Detection and
Error Recovery. Error Control: Error Detection and Error Recovery. Frame length = 1000 bits. We know that the maximum throughput of ALOHA protocol is = 18.4% . System transmits frames at a rate of 56000 bits/second × 1frame/1000 bits = 56
frames/sec. Problem:maximum throughput for ALOHA = 56×0.184 = 10 frames/sec. Problem: Total rate = G. Proportion of empty slots = probability of zero transmission = G^0/0! e^(-G)= e^(-G). When system is operating at maximum throughput.
The maximum throughput of Slotted ALOHA is 0.368 which is achieved at G = 1. Therefore, proportion of the empty slots = e^(-1)= 𝟎.𝟑𝟔𝟖. If we decrease the proportion of empty slots below 𝑒-1 then the throughput will go below its maximum value.
Therefore, it produces an opposite effect on the throughput. Slotted ALOHA-twice the performance of basic Aloha. Slightly longer delay than pure Aloha. Slotted design is also not very efficient when carrying variable sized packets. Good solution if
load is low. Ethernet Backoff Calculation: Challenge: how do we avoid that two nodes retransmit at the same time –repeated collision. Exponentially increasing random delay. Infer “number” senders from # of collisions. First collision: choose K from
{0,1}; delay is K*512 bit transmission times. After second collision: choose K from {0,1,2,3}… After ten or more collisions, choose K from {0,1,2,3,4,…,1023}. WiFi Differ from Wired Ethernet - Signal strength drops off quickly with distance. Path
loss exponent is highly dependent on context. Carrier Sense Multiple Access Before transmitting a packet, sense carrier. If it is idle, send After waiting for one DCF inter frame spacing (DIFS). If it is busy, then Wait for medium to be idle for a DIFS
(DCF IFS) period. Go through exponential backoff, then send. Want to avoid that several stations waiting to transmit automatically collide. Wait for ack- If there is one, you are done. If there isn’t one, assume there was a collision, retransmit using
exponential backoff. Exponential Backoff Force stations to wait for random amount of time to reduce the chance of collision. Backoff period increases exponentially after each collision. If the medium is sensed busy: Wait for medium to be idle for a
DIFS (DCF IFS) period. Pick random number in contention window (CW) = backoff counter. Decrement backoff timer until it reaches 0. But freeze counter whenever medium becomes busy. When counter reaches 0, transmit frame. If two stations have
their timers reach 0; collision will occur; After every failed retransmission attempt: increase the contention window exponentially. 2i –1 starting with CWmin up to Cwmax, e.g., 7, 15, 31, … Request-to-Send and Clear-to-Send - Before sending a
packet, the sender first sends an RTS. Collisions can still occur but chance is relatively small since RTS packets are short. The receiving station responds with a CTS. Tells the sender that it is ok to proceed. RTS and CTS use shorter IFS to guarantee
access. Effectively priority over data packets. First introduced in the Multiple Access with Collision Avoidance (MACA) protocol. Fixed problems observed in Aloha. Virtual Carrier Sense - RTS and CTS notify nodes within range of sender and
receiver of upcoming transmission. Stations that hear either the RTS or the CTS “remember” that the medium will be busy for the duration of the transmission. Based on a Duration ID in the RTS and CTS. Note that they may not be able to hear the
data packet. Virtual Carrier Sensing: stations maintain Network Allocation Vector (NAV). Time that must elapse before a station can sample channel for idle status. Consider the medium to be busy even if it cannot sense a signal. DCF and PCF: PCF
mode in 802.11 is a point coordination function that is used to provide connection oriented, connection-free services by enabling polled stations to transmit without contending for the channel. This function is performed by the point-coordinator in AP
within a BSS. PCF is required to coexist with the DCF and sits on the top of the DCF. The AP waits for the PIFS duration to grasp the channel. PIFS is less than the DIFS duration. Hence, PIFS is used by the PCF to gain the priority access to the medium
at the start of a CFP. DIFS is used by the DCF to transmit data and management MPDUs. Distributed Coordinated function is used to support asynchronous data transfer on a best-effort basis. A station is allowed to transmit an initial MAC PDU under
the DCF method if the station detects the medium idle for a period DIFS or greater. If the channel is found busy during the DIFS interval, the does not initiate transmission and it calculates a random backoff time to schedule a retransmission. DCF deals
with lost and errored frames. Receiving stations transmit ACK frame if the CRC frame they receive is correct. PCF Operation PC – Point Coordinator- Uses polling – eliminates contention. Polling list ensures access to all registered stations. Over DCF
but uses a PIFS instead of a DIFS – gets priority. CFP – Contention Free Period. Alternate with DCF. Periodic Beacon – contains length of CFP. NAV prevents transmission during CFP. CF-End – resets NAV. CF-Poll – Contention Free Poll by PC.
Stations can return data and indicate whether they have more data. CF-ACK and CF-POLL can be piggybacked on data.
Note 5 Diversity Space diversity: use multiple nearby antennas and combine signals. If antennas are sufficiently separated, instantaneous channel conditions are independent. Antennas should be separated by ½ wavelength or more. If one antenna
experiences deep fading, the other antenna has a strong signal. Time diversity: spread data out over time. Frequency diversity: spread signal over multiple frequencies. Selection Diversity - Receiver diversity: receiver picks the antenna with the best
SNR. Transmit diversity: sender picks the antenna that offers the best channel to the receiver. Receiver Diversity—Can We Do Better?- Maximal ratio combining: combine signals with a weight that is based on their SNR. FHSS- different carrier
frequencies are modulated by the source signal. The signal is broadcast over a random series of radio frequencies, hopping from frequency to frequency at fixed intervals. A receiver receives the message and hops between frequencies in synchronization
with the transmitter. The transmitter operates in one channel at a time for a fixed interval. A spreading code is used to indicate the sequence of channels used. Both the transmitter and receiver use the same code to tune into a sequence of channels in
synchronization. DSSS: In DSSS, each bit in the original signal is represented by multiple bits using a spreading code in the transmitted signal. The spreading code is called chips and bit-rate of the chip is called chip rate. Spreading code spreads signal
across a wider frequency band. Spread is in direct proportion to number of bits used. E.g. exclusive-OR of the bits with the spreading code. The resulting bit stream is used to modulate the signal. Difference b/w FH-CDMA and DS-CDMA The devices
that use FH-CDMA technology consume less power and are cost effective whereas DS-CDMA systems are more reliable and perform better. FH-CDMA technology is based on the coexistence of various access points in the same area which is not
possible in DS-CDMA. In FH-CDMA, faster synchronization is required whereas in DS-CDMA, slower synchronization is required. In FH-CDMA, no severe near far interference problems are present therefore, no accurate transmit power control is
required whereas in DS-CDMA, interference problems are present. In FH-CDMA, PN generator clock rate is considerable slower than DS-CDMA. FEC: Forward error correction (FEC). The sender adds redundant data to its messages, also known as an
error correction code. This allows the receiver to detect and correct errors (within some bound) without the need to ask the sender for additional data. A return channel is not required, or that retransmission of data can often be avoided, at the cost of
higher bandwidth requirements on average. Key Idea of Error Detection All transmitted data blocks (“codewords”) satisfy a pattern. If received block doesn’t satisfy pattern, it is in error. Redundancy: additional information required to transmit.
Blindspot: when channel transforms a codeword into another codeword. Reed-Solomon Codes