tsam

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Synchronising, in networking terms:

Is expensive - it costs information capacity, and often compute time, as processes/machines have to wait for everything to report in.

TCP/IP reference model

Is the most widely used internet model. It is often known as the internet protocol suite. The TCP/IP protocol suite has two of the most important protocols, TCP (Transmission Control Protocol) and IP (Internet Protocol)

different kind of communication types used in sockets after protocols

SOCK_STREAM: Sequenced, reliable 2-way stream (TCP) SOCK_DGRAM: Fixed length, unreliable message (UDP) SOCK_RAW: Raw network socket access SOCK_NONBLOCK: Non-blocking socket (polling)

Statistical multiplexing

is a time-division multiplexing technique in which time slots are dynamically allocated on the basis of need (i.e., slots are allocated to equipment with data to be transmitted). Statistical multiplexing is a method used in telecommunications and computer networks to share a single communication channel among multiple users or data streams. Unlike time-division multiplexing, where each user or stream gets a fixed portion of channel capacity at regular intervals, statistical multiplexing dynamically allocates bandwidth to each user or data stream based on its demand and the overall channel's availability. Dynamic Allocation: The core idea behind statistical multiplexing is that not all users or data streams will require the channel's full capacity simultaneously. By dynamically allocating bandwidth, statistical multiplexing makes efficient use of available resources.

Fisher Consensus:

"It is impossible to guarantee that any asynchronously connected set of nodes (computers), can ever agree on even a single bit value." 1. Can't solve it, have to either work around it , or live with it. 2. Synchronize - i.e. have a single point of failure 3. Live with it, catch errors when they happen 4. For many applications, as long as you're aware of Fisher, it's not an issue. 5. Note the tendency to drive distributed programmers mad... It demonstrates that in an asynchronous distributed system (where there is no guaranteed upper bound on the time it takes for a message to be delivered), it is impossible to reach consensus if there is even one process (node) that might fail. This result is particularly important for the field of distributed computing because it highlights the limitations of what can be achieved in terms of agreement among distributed processes when certain conditions, like asynchrony and potential failures, are present.

Interface to network layer (from datalink layer)

- Perform character encoding, transmission, reception and decoding - i.e. determing the start and end of packets (framing) - Simple transmission error handling -i.e. error detection and correction -Error recovery -This may be delegated to (or repeated by) a higher level -The datalink layer is not required to guarantee data integrity -"The upper layers will recover" (or die in the attempt)

Cleaning fibre optic cables:

-1 micrometer dust particle on a single-mode core can block up to 1% of light -9-micrometer particle can completely block the core -Oils and other residues will also degrade signal (human fingers) -The laser can burn residues onto surface - damaging equipment -Never look into the end of a fibre optic cable -Never touch the end of a fibre-optic cable

Ports

-16 bit unsigned integer -specific to host - Ports 0 .. 1023 are "Well known ports" and are assigned by the OS - Ports 1024 .. 65535 are Registered/Ephemeral ports available to applications

ATM (Asynchronous Transfer Mode)

-ATM is a fixed packet size (cell) core protocol, and approximately maps the network, data and physical layer. -This is one (of several, bluetooth is another) example of the protocol layers not behaving exactly the way the models presents. The basic principle of layered separation, and the nature of the relationships between them, is correct - but as long as those service relationships are honoured, you can slip whatever you want in between them

Error correction

-Add redundant information to the frame -Allows errors to be detected, and corrected -Tradeoffs: -More information added, longer the frame -Increases probability of error -Increases transmission cost/processing -Increases cost of processing at receiver -But: avoids cost of having to retransmit the frame

Framing - Character based frame signalling:

-Also known as "flag byte" -Main framing method from 1960 - 1975 -ASCII and EBCDIC character encodings include special characters -SYN - Synchronous idle (026) -STX - Start text (002) -ETX - End text (003) -EOT End of transmission (004) -CRC cyclic redundancy check -Used to flag communication, so cannot appear in data

Time division multiplexing (TDM):

-Alternatively can use fixed allocation -TDM -The available bandwidth is divided equally between hosts -Each host gets this "slot" -Can only transmit using that slot, and at no other time -Atvantages: -Hosts are guaranteed a certain bandwidth (Quality of service) -Easier to synchronise when applications require it -Disatvantage: -Wasteful, if host doesn't use its allocation, nothing else can

How does the sender know it's being received?

-Ans: Receiver sends back acknowledgment frames -ACK - Acknowledgment -NACK - Negative acknowledgement - error in frame -Suppose the receiver doesn't get the frame at all? -Timer on acknowledgement is kept -Must be received within specified interval -Suppose the receiver gets multiple copies of a frame? -Frame header includes a sequence number

Strictly hierachial topology

-Best topology for control purposes e.g. botnets -Worst topology for exchanging information -Robust to broadcast storms with increasing N -Required if consensus must be guaranteed

Bit oriented framing

-Byte stuffing imposes a particular character format -Bit stuffing just uses a pattern of bits to signal start/end frame -Each frame begins with Bit pattern 01111110 -6 bits in a row -Constant flags or 1's indicate an idle connection -Bit stuffing inserts a 0 after any 5 bits in data -Regardless of what the next character would be -Receiver similarly removes -Invented by IBM in 1970 for SDLC (Synchronous Data Link Protocol)

Framing - Fixed length frame

-Can make software's life easier - but not necessarily efficient -Fragmentation occurs if message is longer than the frame -There is no optimal frame length -Can be very inefficient -But does make some of the queuing problems a little easier -And reduces jitter -ATM (Asynchronous transfer mode) -Late 20th century attempt to use cell based switching for high speed data transmission -Cell size was 53 bytes -US and European PTT's couldn't agree, so they split the difference

Advantage of bit stuffing

-Can vary the length of the flag -Longer flag will reduce need for stuffing (less likely) -Short packet use a short flag - less overhead and liklihood -Note: -Can also combine with other techniques for efficiency/safety -i.e. send frame length, and use start/stop flags

Scaling and the three key attributes that affect it:

-Constraints on systems that depend on size -For network based systems, we can reduce this to three key factors: -Topology -Latency -Size (number of nodes) Each of these affects the other

Physical layer - Copper:

-Copper (wire) transmission dominated early networking -Dedicated links for data communication -Or carried over phone lines (modems) -Both had relatively low capacity, and a lot of errors -The network was the bottleneck -Consequently network transmission protocols: -Favored computational solutions over transmission solutions -i.e. error detection and correction over re-transmission -Everything possible was done to preserve bandwidth -This heritage still influences protocols -Today we have split between fiber (practically error free) and wireless (high error rates) -Copper is still in wide use in many countries ("last mile problem")

How CRC works

-D(x): data -D'(x): data with appended 0s (padded) -Let D'(x) = P(x)G(x) + R(x) 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0 D'(x) - 0 1 1 1 0 R(x) = 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 T(x) = D'(x)-R(x) The reason this is so powerful, is that it takes advantage of pre-transmitted information (G(x)) and so reduces the extra information that needs to be transmitted (see code books)

What if the flag byte occurs in the data?

-Easily (inevitably) happens with binary data -Two techniques: Byte stuffing and bit stuffing

Engineering statistical multiplexing:

-Efficient: Maximises use of capacity -To much traffic from hosts will cause blocking -Flow control must slow down traffic to fit available bandwidth -Also relies on being able to queue or delay packets

Data link protocols:

-Ethernet Local Area Networks (LAN) -Point - to - point (PPP) RFC 1661 -Telephony protocols provides datalink over duplex circuit -Duplex - can communicate in both directions -Half-duplex - both directions but only one at a time (eg. walkie-talkie) -Full-duplex - both directions simultaneusly -Data link protocols respond to request from the network layer -Issue request to the physical layer

Design choices (Tradeoffs):

-Fixed packet size versus variable packet sizes -Synchronized vs unsynchronised -syncronised protocols send packets at fixed times -synchronisation is one way to duck consequences of Fischer consensus -Error correction vs retransmission of packets -Acknowledge packet - Dont acknowledge and detect missing packets somehow -Acknowledgements can create significant overhead -Connectionless - connection oriented -Connectionless: Messages can be sent without arrangement -Connection: eg. phone call, tcp/ip - circuit setup and can then talk

Statistical multiplexing / Multiple Access Protocol

-Fundamental tool used in communicating networks -Assumption: multiple hosts can share as connection =>Provided the don't try to all use it simultaneously -Widely used trick, libraries with lending media, roads and cars, banks - relationship between cash or gold and bank deposits, etc. -Dynamic Bandwidth Allocation: The available bandwidth is not divided into fixed portions as in (TDM). Instead, bandwidth is allocated on demand, according to the instantaneous data rate needs of the channels. -Efficiency: This improves efficiency because the total bandwidth can be less than the sum of the bandwidths required if each channel were to be given a fixed allocation. -> not all channels need to transmit data at the same time. -Buffering: Data streams are buffered to accommodate the varying data rate, buffer management avoids overflow and underflow. -Commonly used in packet-switched networks. Data streams are divided into packets, which are then transmitted as resources become available.

Local area network (LAN)

-Geographical Area: LANs are restricted to a small geographical area, typically within a single building or a campus. -Speed: They generally offer high data transfer speeds, up to or exceeding 1 Gbps. -Ownership: LANs are usually owned, controlled, and managed by a single person or organization. -Connectivity: Devices such as computers, printers, and servers within an office or home environment are connected. -Technology: Ethernet is the most common LAN technology. Wi-Fi is also used for wireless LANs. -Maintenance: Maintenance and setup costs are relatively low because of the smaller size and less complex infrastructure. -Latency: LANs typically have lower latency because of the proximity of devices.

Wide are network (WAN)

-Geographical Area: WANs cover a large geographical area, potentially worldwide, connecting multiple LANs. -Speed: The data transfer speeds over WANs are generally slower compared to LANs due to the greater distances and the complex nature of inter-connectivity. -Ownership: WANs may be owned by multiple organizations or might be leased as a service from a third party (e.g., an internet service provider). -Connectivity: WANs connect devices from multiple locations, including LANs, metropolitan area networks (MANs), and other WANs. -Technology: WAN technologies include MPLS, ATM, Frame Relay, and X.25 for older networks, as well as VPNs and the public Internet for newer networks. -Maintenance: Maintenance and setup costs are higher due to the scale and complexity of the network, involving multiple routers, switches, and other infrastructure components across vast distances. -Latency: WANs typically experience higher latency due to longer distances and multiple hops between networks.

Framing - Transmit the length of the frame

-Header field includes length of the frame -Header itself should be fixed length -Which restricts the length of the length field -Which in turn restricts packet size -More importantly: -Difficult to recover from errors in the length count itself -How do you find the next header -This is used more in upper layers -While it's also possible to have variable length header fields, it is less desirable due to the additional complexity

Network hub:

-Hubs are simple connection devices -Connects several devices onto one link -Broadcasts received packets to all connected devices -Bandwidth split between all connected devices -Now being phased out in favour of network switches

Framing - Data is sent in separate frames

-Receiver problem - how to find the frame: -Possible solutions: -Transmit the length of the frame -Use a fixed length frame -Use a flag or pattern to indicate start/end of frame -What happens if the data contains the bit pattern used as a flag? -Flag bytes with byte stuffing -Flag bits with bit stuffing

Routers

-Routers forward packets between (local) networks -For example, the campus network to the internet -Or your home network to the internet

Net-work order

Is big-endian f.x. 0x1234 is represented as 0x12, 0x34 htons() and ntohs() amongst others convert to/from network and host order

Byte stuffing:

-If the sender sees a Flag in the data inject a ESC byte -Receiver sees only one Flag - genuine end of frame -Otherwise remove duplicate -Similarly for ESC, inject another ESC So if the receiver sees a ESC in the data he knows that there is more data after the flag byte that comes and it is not flaging the end of a message. The user should therefore ignore the byte that comes after the ESC byte

Fiber optic cables

-In fiber-optic cables the light is moving through a glass core -Actual speed in fibre-optic cables depends on: - Refractive index of glass core - Wavelength of light being used -For most applications: speed of light in the cable (latency) = speed of light (3*10^8 m/s)/ refractive index of cable

Full mesh topology

-Information capacity scales as L(L-1) -Best topology for exchanging information for small groups -Size is bounded by the group size -Worst topology for control -Vulnerable to broadcast storms

Partial mesh topology

-Information capacity scales as L√(N) -Cannot guarantee consensus -Depending on error rate, voting algorithms can provide strong guarantees -Vulnerable to broadcast storms with increasing N

Local area networks:

-Local area networks rely on broadcast to solve the problem of address discovery

What is group size?

-Maximum connectedness at a node -Maximum no. of single hop connections that a given node can support -For any single computer - it depends -Bandwidth -Application requirements -CPU -Larger network considerations

Disadvantages of fibre-optic caples:

-More expensive per meter than copper ($40/m) -Optical fiber cannot be easily joined together -"Splicing - training and specialized equipment required" -Ends have to be periodically inspected and cleaned -Specialized training -Equipment: Fiberscope -Fragile - must not be bent too much ( breaks the glass in the middle) -Minimum bend radius should not be more than 15 times the cable's diameter -Copper is usually already available

Network switch

-Network switches connect directly to computers, printers, phones, etc -Packets are sent only to the destination computer -Unmanaged - works out of the box, no configuration -Managed can be controlled and customised -Handles a local area network (LAN)

unsynchronized communication

-Not synchronized -Frames have to have start/end frame markers -i.e. 1 start bit, 8 data bits, 1 stop bit -Incurs a high overhead When the receiver is decoding the data, it looks for the pattern of a start bit 8 bits and a stop bit, and it is not untill it finds thath it will "lock on" to the data and be able to decode the stream -e.g. Serial communication so UART, modem etc

Statistical multiplexing depends on:

-Number of hosts -Amount of traffic -Frequency of traffic -Capacity of channel -Amount of money (capital) available

There are a lot of terms for essentially the same thing:

-Protocol data unit (a message from one side to the other) -@Physical layer == Bit -@Data link layer == Frame -@Network layer == packet -@Transport == Segment (TCP) Datagram (UDP)

"The upper layer will recover"

-Protocol stack builds upwards in complexity and services offered -Reliability, data order, are high level services -In so much as possible, upper layers should not be aware of the lower level's details -The interface between the layers is similar to a contract -Lower layer provides specified services to upper layer -Lower layers in particular should be plug and play -eg. copper, wireless, fibre all use different low lever protocols that are designed for the characteristics of that medium. -The IP layer is blissfully unaware of this -But it can matter at the application layer

OSI 7 layer model

-Separated out 7 layers for different aspects of communication -Each layer performs clearly defined functions -Minimise dependency (information flow) across the layers -Each layer depends on the previous one -In practice, only the first 3.5 layers were typically used - ... giving rise to the simplified TCP/IP reference model

Wireless - Broadcast medium

-Shannon definition of information was based on "difference" -Broadcast media send the same information to all nodes -Inherently lower information capacity than equivalent point-to-point network -Note: nothing stops a broadcast being performed on a point to point network -Disadvantages: -High losses due to interference -Frequency use has to be carefully regulated -Higher delays and jitter -Lower security

Cyclic Redundancy Checks

-Slightly more complicated form of error detection -Based on theory of cyclic error-correcting codes -Takes advantage of maintaining known additional information at each end -Principle: divide string(frame) by a generator polynominal G(x) -Add the remainder R(x) onto the end of the frame -@Receiver divide frame by G(x) -Non-zero remainder indicates error

Example of network provisioning: Given a set link capacity, how many users can be provisioned, and maintain performance "guarantees"?

-Sometime referred to as "oversubscription" -There is no absolute answer -eg. 100 Gbps link, each customer is sold 1 Gbps each -100% capacity = 100 customers -4:1 oversubscription would be 400 customers -i.e. customer is using on average 25% of bandwidth -2:1 oversubscription is 200 customers (50%) -From ISP perspective, twice as expensive -Issues: burst, heavy sustained use -Commercial (buisness hour) use, vs household (evening and weekend) -Dedicated bandwidth if customer asks for it

Synchronised Communication

-Synchronized by some kind of external clock -Receiver expects frames to arrive at fixed frequency -Uses clock to read frames from the wire -Problems include drift, and in the limit Einstein and Fisher Synchronous communication at some level is much easier for everybody - if it works. The problem is synchronizing becomes progressively harder the more nodes are involved, and the longer the distances - that said a lot of low level synchronous protocols exist and are used very succesfully for local communications

Hamming codes:

-The principle is that we add extra parity bits at powers of 2 to the data bits -Each parity bit calculates parity for a subset of the bits in the message -Parity bits themselves not included in checks -The parity bit at position 1 covers all bit positions with a binary representation ending in ...01 (e.g., 1, 3, 5, 7, 9, etc.). -The parity bit at position 2 covers all bit positions with a binary representation ending in ...10 (e.g., 2, 3, 6, 7, 10, etc.). -The parity bit at position 4 covers those in position 3 ..0100 (e.g. 4-7, 12-15, 20-23, etc.)

Physical layer, key concepts:

-The unit of information is a bit -Information is a measure of different data - Send 100 people the same message = 1 piece of information - ditto = 100 piece - eg. Broadcast Television/Radio - Good: Everybody listening is synchronised - Bad: Huge drop in the potential information shared -Bandwidth is either - Signal Processing: - The difference between the highest and lowest frequency in a signal (Hertz) - Data Communications: - Maximum rate of data transfer across a given path (bits/sec)

Advantages of fibre optic cables

-Thinner (important for cabling considerations) -Much higher capacity -Less signal degradation with distance -Requires fewer repeaters -Lower power

Processing latency:

-Time taken to process a message by the recipient -Time taken to process a message by the revcipient -e.g. email vs block -Longer communication latencies favour distributed networks - more processing power

Communication latency:

-Time taken to send a message between two nodes -Long communication latencies favour hierarchical networks -Short communication latencies favour distributed ones. -Communication usually (not invariably) relies on a send - receive protocol

Organised Mesh topology

-Topology that can scale to large N and grow capacity -Similar issues to other mesh topology

What happens if one end sender sends faster than the other can receive? (flow control)

-Two approaches: -Negotiate fixed speed between sender/receiver -Feedback-based - receiver tells sender to pause -Typically fixed speed used at lower protocols levels -Higher levels use some kind of feedback eg. Ctrl-S, Ctrl-Q -Or simply the convention of send message/wait to response

There are three main variants:

-Unacknowledged connectionless service eg. Ethernet -Aknowledged connectionless service eg. WIFI(802.11) -Acknowledged connection-oriented service eg. TCP

Time to transfer a 100MB file over a 10Mbps link?

-Units: 10 MBps (megabytes) == 80 Mbps (megabits) -Disk drives measure in bytes, networks in bits -Network overhead - packet sizes etc -Assume no network overhead... -100MB == 800 Mb, @10Mbps, is 80s -10GB (gigabytes) @10Mbps, is 2 hours, 16 minutes (approx)

Error detection: Partity check:

-Very simple: partity bit / check bit -Add a partity bit to the frame -Count number of bits in a frame -If no. of 1 bits is ODD, partity bit = 1 -If no. of 1 bits is EVEN, partity bit = 0 -Result: Number of 1 bits is always EVEN -Technically: special case of Cyclic Redundancy Check (CRC)

Flag errors:

-What if the FLAG or ESC bytes get corrupted? -All framing techniques are sensitive to errors -May either detect premature end of frame -Or run on too long into next frame -Frame checksum will fail the receiver -Can then find next frame by looking for FLAG So the bad frame will be dropped. What happens then depends on protocols at the datalink level and above. Some of the datalink protocols attempt to resend, but more often the upper layers are relied on to recover.

TCP connection flow:

1. In tcp/ip for example, the application layer (read(), write()), is blissfully unaware of the details of the transport layer SYN/ACK messaging 2. There can be an associated loss of knowledge - the application layer knows that the connect() failed - but not necessarily all the detail of why 3. Nothing btw. stops the application layer building its own protocols - large distributed systems will typically have to do this

Layers of the TCP/IP model

1. Link (Network access layer) 2. Internet 3. Transport 4. Application

The 7 layers of the OSI model:

1. Physical 2. Data link 3. Network 4. Transport 5. Session 6. Presentation 7. Application

Data link functions:

1. Provide a well-defined interface to the network layer 2. Deal with transmission errors 3. Regulates the flow of data so that slow receivers aren't swamped by fast senders

Nyquist rate:

2*Bandwidth Hz (cycles per second) Upper bound on the symbol rate across a bandwidth limited channel i.e. maximum possible transmission rate

What is a broadcast storm?

A broadcast storm is an increase in traffic above the capacity of the network to carry it

protocol family in Sockets that uses Ip

AF_INET

Data integrity

All your data arrives intact. Data can be lost at the datalink level, and it then becomes the problem of the upper layers to recover from it

Raw Sockets

Allows access to the raw packet layer. They are used when you want to hand craft packets, forge packets, network scanning etc. They provide completed control over message header

Kurose: An ideal multiple access protocol

An ideal multiple access protocol -given: broadcast channel of rate R bps -desiderata: 1. When one node wants to transmit, it can send at rate R 2. When M nodes want to transmit, each can send at average rate R/M 3. Fully decentralized: -No special node to coordinate transmissions -No synchronization of clocks, slots 4. Simple -Assume nodes arrange to transmit co-operatively and don't block each other -It's called "Statistical" precisely because the chances of this happening are pretty much 0

Backbone routers

Backbone routers are integral components of the core network infrastructure, which is commonly referred to as the backbone or backbone network. The backbone is a central conduit designed to transfer data among various subnetworks, providing a path for the exchange of information between different LANs, WANs, or other networking models.

Crosstalk in copperwires:

Crosstalk refers to the unwanted transfer of signals between communication channels. It's essentially a form of interference caused when the signal from one wire or cable "leaks" into another which can result in decreased performance and data errors Causes: Physical Proximity: Wires that are close to each other can induce electrical signals in one another. Improper Twisting: In twisted-pair cables, the twists are designed to reduce crosstalk. If these twists are undone or if they're not consistent, it can increase the risk. Poor Quality Components: Inferior connectors, patch panels, and jacks can introduce or exacerbate crosstalk Effects: Data Errors: can lead to errors in data transmission, resulting in corrupted or lost data. Reduced Network Speed: High levels of crosstalk can cause retransmissions and slow down network speeds. Reduced Cable Distance: maximum distance that signals can be transmitted might be reduced

Blocking socket

Default in TCP Server waits until it receives at least 1 byte For example, if you issue a blocking recvfrom() call, the call does not return to your program until data is available from the other socket application. A blocking accept() call does not return to your program until a client connects to your socket program.

What is delay?

Delay is the time it takes for a packet to travel from the source to the destination. It's often consistent on a stable network.

What is a protocol?

For any form of communication to occur, both ends have to agree how they are going to communicate, and how they are going to communicate it. Two computers have to agree on a protocol to communicate

Home routers:

Handles local home WiFi network, any wired connections, and performs network address translation between the home network and the internet

Trade offs between Hierarchial and Mesh:

Hierarchial: -Relatively simple -Single point of control -Good for synchronization -Fragile - single point of failure -Low information capacity -Cannot scale to large N (nodes) -Good at high latency communication -Vulnerable to broadcast storms. Mesh: -Complicated -No single point of control -Impossible to guarantee consensus -Robust - hard to crash -High information capacity -Scales to large N -Poor performance -Very vulnerable to broadcast storms.

Heizenbugs

If a bug in a program depends on time at all, we get so called heizenbugs The appear and disappear somewhat randomly

Error recovery

It there is an error, transmission continues

Shannon limit on information in a single channel:

Key point: C depends on bandwidth (Hz), so it depends on the maximum frequency that can be used on a given medium, and on the energy required to transmit that signal. Hence the domination of fibre (@light frequencies) over copper. Also - in a given medium, lower frequencies propagate further and require less energy than higher ones. C = B * log2(1 + S/N) C = Maximum channel capacity B = Bandwidth in Hz S = Signal power over bandwidth (Watts) N = Average power of noise

Metric units:

Kilo - 10^3 Mega - 10^6 Giga - 10^9 Tera - 10^12 Peta - 10^15 Exa - 10^18 Zetta - 10^21 Yotta - 10^24

The main difference between WAN and LAN:

LAN (Local Area Network) and WAN (Wide Area Network) are two primary types of networks that differ in terms of their geographical scope, speed, management, and the technologies they use LANs are designed for private use within a localized area, offering faster speeds, low latency, and easier management. WANs, on the other hand, are built to connect networks over large geographical areas, with slower speeds and higher latency, often relying on telecommunications providers and more complex technologies.

Last mile problem:

Last mile problem is essentially the most of the cost providing a network connection is installing the last mile of cable into the house. The last mile is the majority of all costs in a network

Nyquist limit:

Minimum number of samples needed to reconstruct a signal. Applies generally to any oscillating signal/system -Must have 2 full cycles to be able to accurately reconstruct -i.e. Range of human hearing is 20 Hz to 20kHz -CD's are sampled at 44100 samples per second

Byte stuffing example:

Original -> After stuffing A | FLAG | B -> A | ESC | FLAG | B A | ESC | B -> A | ESC | ESC | B A | ESC | FLAG | B -> A | ESC | ESC | ESC | FLAG | B A | ESC | ESC | B -> A | ESC | ESC | ESC | ESC | B

Parity bit calculation

Parity Bit Calculation: -P 1 = D7 ⊕ D6 ⊕ D5 -P 2 = D7 ⊕ D6 ⊕ D3 -P 3 = D7 ⊕ D5 ⊕ D3 If we now calculate: -A = P 1 ⊕ D7 ⊕ D6 ⊕ D5 -B = P 2 ⊕ D7 ⊕ D6 ⊕ D3 -C = P 3 ⊕ D7 ⊕ D5 ⊕ D3 ABC is then the subscript of the errored bit -⊕ == XOR (modulo 2 addition)

circuit switched-networks

Principle: A dedicated communication path or circuit is established between the sender and receiver for the duration of their conversation. No other communications can use this path during this time. Advantages: - Consistent Quality: Because a dedicated path is established, the quality (like latency) is consistent and predictable. - Low Overhead: Once the circuit is established, the transmitted data doesn't need the same kind of headers and metadata as in packet-switched networks. - Suited for Continuous Transmission: Such as voice calls. Disadvantage: - Inefficiency: The dedicated circuit cannot be used by other communications, even if the primary users aren't sending data. This can lead to wasted capacity. - Scalability Issues: Requires significant infrastructure to support a large number of simultaneous communications, especially over long distances. - Less Resilient: If a part of the circuit fails, the entire communication is interrupted. Examples: Traditional telephone networks

Packet switched-networks

Principle: Data is broken up into packets, each with source, destination, and other metadata. These packets are sent independently through the network and may take different routes to reach the destination. Upon arrival, they are reassembled in the correct order. Advantages: - Efficiency: Multiple communications can share the same network resources, leading to high resource utilization. - Scalability: Easily handles a large number of devices and users. - Flexibility: Can dynamically adapt to network failures or congestion. - Suited for Bursty Data: Such as web browsing or file transfers. Disadvantages: - Variable Latency: Because packets might take different paths and face network congestion, there can be variability in delivery times. - Overhead: Each packet contains header information, which adds overhead to the transmitted data. Examples: The Internet, Ethernet networks.

Non-blocking sockets

Server checks for data, but continues if there isn't any If the I/O call could not be completed, it returns with ERRNO EWOULDBLOCK. (The calling program should use SELECT() to test for completion of any socket call returning an EWOULDBLOCK.) Returns error "Operation would block" if: - Read() buffer is empty - Send() buffer is full

Berkeley sockets API: what meaning does these have? -Socket -Bind -Listen -Accept -Connect -Send -Receive -Close

Socket - Create a new communication endpoint Bind - Attach a local address to a socket Listen - Announce willingness to accept connections Accept - Block caller until a connection request arrives Connect - Actively attempt to establish a connection Send - Send some data over the connection Receive - Receive some data over the connection Close - Release the connection

Client-Server Communication (TCP)

TCP server 1. open a socket 2. bind socket to a port an Ip 3. listen for incoming requests to this Ip and port 4. accept incoming request ---- connection established ---- - read incoming data request from client - process the request - write data reply and send to the client - This happens until the connection is closed - read end of file notification when client closes connection - close the socket TCP Client 1. open a socket 2. connect socket using Ip and port ---- connection established ---- - write data request to send to server - read data reply to server This happens until the socket is closed

Layer 4: Application layer

TCP/IP classifies all application-related contents into the application layer and ensures data grouping and packaging for the next layer. The application layer contains all high-layer protocols, such as RTP, DNS, SMTP, HTTP, etc

Layer 2: Internet layer

The internet layer is layer 2 of the TCP/IP model. It is responsible for the best path selection and packet switching during data transmission. It provides selecting transmission paths and traffic congestion control services for the transport layer. The management protocol of the internet layer is IP (Internet protocol) and ICMP (Internet control message protocol)

Layer 1: Link layer (network access layer)

The network access layer is the bottom layer of the TCP/IP model. The main functions of the network access layer are basically consistent with the physical layer and the data link layer in the OSI model. It is responsible for sending and receiving data packets through the networks and the transmission of information between computers. protocols: DSL(Digital Subscriber Line), SONET(Synchronous Optical Networking), 802.11(family of evolving specifications for wireless local area networks), Ethernet

Layer 3: Transport layer

The transport layer is mainly designed to provide the reliability of data transmission and flow control functions. The transport layer has two transmission protocols, TCP (Transmission control protocol) and UDP (User datagram protocol). TCP applies for applications with high reliability requirements, while UDP works for low reliability requirements and economical transmission TCP can provide reliable data transmission, allowing services like data flow transmission, reliability, flow control, full-duplex operation and multiplexing. Generally speaking it establishes and connects the channel for the transmitted data in advance, then sends the data, and finally cancels the channel. However UDP may cause data loss, disorder, and error, but it has the advantage of flexible and fast transmission

Topologies networks:

There are broadly, 3 different classes of topologies of networks - about which we can make some general statements -Strictly hierarchical -Full mesh -Partial mesh

Wireless technologies

With wireless technologies the physical and data link layers use different protocols, and have notably different characteristics than copper and fibre. Data link: 802.11 and 802.3 MAC - CSMA/CA = Carrier Sense multiple avoidance Physical link: 802.11 and 802.3 PHY Following the general principles of layered design though, it's possible to "plug and play" protocols between the different layers. Key the approaches ability to adapt to widely varying behaviors

Connectionless protocols:

does not require a connection to be established before data is transmitted between two devices. Characteristics: No Handshaking: They do not set up a dedicated communication path before sending data. Stateless: They do not keep track of the state of the communication between devices. No Error Correction: There is typically no built-in mechanism for ensuring that data is delivered without errors. Efficiency: can be more efficient some loss of data can be tolerated or data to be received in the same order it was sent is not rquired. well-suited for broadcast and multicast where data is sent to multiple recipients without establishing a connection. Examples: -UDP is often used for video streaming and online gaming where speed is more critical than reliability. -IP is a connectionless protocol used for routing packets across the internet between hosts and networks but does not guarantee packet delivery. -ICMP is used for diagnostic and error-reporting purposes. fx ping.

What is jitter?

n computer networks, jitter refers to the variation in time delay in milliseconds (ms) between data packets over a network. Essentially, it's the measure of the temporal change in the delay between data packets arriving, caused by network congestion, timing drift, or route changes. Here's a more detailed explanation: Jitter, is when there's a variation in network delay. For instance, if most packets take 10ms to travel from the source to the destination but a few packets take 20ms or only 5ms, this inconsistency is what we call jitter. Causes of Jitter: -Network Congestion -Route Changes: If the route a packet takes changes during transmission, which can happen if routers seek to find the fastest path, the time it takes for packets to reach their destination can vary. -Imperfect Network Hardware: Flaws in routers, switches, or other network hardware can cause packets to be delayed or processed at different speeds.

Connection oriented protocols

require a session or connection to be established between two endpoints before data is transmitted. f.x. phone call where you first establish a connection with the person you want to speak to before starting the conversation. this usually involves a series of messages that are exchanged to establish a connection, manage the data transfer, and then terminate the connection once the communication is complete. Handshaking: to set up the end-to-end connection before any data is transmitted Stateful: These protocols maintain state information about the connection throughout its life Error Correction: They provide error checking and correction to ensure data is delivered reliably, in order, and without duplication. Flow Control: They manage the rate of data transmission to prevent overwhelming the receiver or network. Congestion Control: They often have mechanisms to detect and respond to network congestion, reducing the transmission rate when necessary to alleviate the congestion. -TCP


Set pelajaran terkait

English unit 2 poetry collection Answer test

View Set

Chapter 12 - Financial Leverage and Financing Alternatives

View Set

Social Studies: Ch.20 and 22 Notes

View Set

Unit 6: Test Taking Strategies- Best Answer Tests

View Set

CHAE AND TIFF- UNIT TEST: Ecosystems

View Set