Computer NetworkComputer Network

How computers talk to each other: layers, addresses, routing, TCP/IP, and the protocols behind the web. Computer-রা কীভাবে একে অপরের সাথে কথা বলে: layer, address, routing, TCP/IP আর web-এর পেছনের protocol গুলো।

1. OSI and TCP/IP Models1. OSI এবং TCP/IP Model

A network is very complex. So we break the job into layers. Each layer does one small job. Each layer talks only to the layer above and below it. The OSI model has 7 layers. It is a reference model — a way to think and talk about networks.

Easy memory trick (top to bottom): "All People Seem To Need Data Processing" — Application, Presentation, Session, Transport, Network, Data Link, Physical.

Network অনেক জটিল একটা জিনিস। তাই পুরো কাজটাকে আমরা layer-এ ভাগ করি। প্রতিটা layer একটা ছোট কাজ করে। প্রতিটা layer শুধু তার উপরের আর নিচের layer-এর সাথে কথা বলে। OSI model-এ 7টা layer আছে। এটা একটা reference model — network নিয়ে চিন্তা করার একটা সহজ উপায়।

মনে রাখার সহজ কৌশল (উপর থেকে নিচে): "All People Seem To Need Data Processing" — Application, Presentation, Session, Transport, Network, Data Link, Physical।

# LayerLayer Main jobপ্রধান কাজ Example protocols / devicesউদাহরণ protocol / device Data unit (PDU)Data unit (PDU)
7Application Services for the user's programsUser-এর program-এর জন্য service HTTP, FTP, SMTP, DNS, DHCPData
6Presentation Data format, encryption, compressionData format, encryption, compression SSL/TLS, JPEG, ASCIIData
5Session Start, manage, and end sessionsSession শুরু, চালানো এবং শেষ করা NetBIOS, RPC, socketsData
4Transport End-to-end delivery, reliability, portsEnd-to-end delivery, reliability, port TCP, UDPSegment (TCP) / Datagram (UDP)Segment (TCP) / Datagram (UDP)
3Network Logical (IP) addressing and routingLogical (IP) addressing এবং routing IP, ICMP, OSPF; RouterPacket
2Data Link Framing, MAC addressing, error detectionFraming, MAC addressing, error detection Ethernet, PPP, ARP; SwitchFrame
1Physical Send raw bits over a wire or airতার বা বাতাস দিয়ে raw bit পাঠানো Cables, fiber, Wi-Fi radio; Hub, RepeaterCable, fiber, Wi-Fi radio; Hub, RepeaterBit

TCP/IP model and mappingTCP/IP model এবং mapping

The real Internet uses the simpler TCP/IP model. Books show it with 4 layers, and sometimes 5 layers (Physical split out). This table maps them to OSI.

বাস্তবের Internet একটু সহজ TCP/IP model ব্যবহার করে। বইয়ে এটা 4 layer-এ দেখানো হয়, কখনো 5 layer-এও (Physical আলাদা করে)। নিচের table-এ OSI-এর সাথে mapping দেখানো হলো।

OSI (7 layers)OSI (7 layer) TCP/IP (4 layers)TCP/IP (4 layer) TCP/IP (5 layers)TCP/IP (5 layer)
Application, Presentation, SessionApplicationApplication
TransportTransportTransport
NetworkInternetNetwork
Data LinkNetwork Access (Link)Data Link
PhysicalPhysical

Encapsulation: how data travels downEncapsulation: data কীভাবে নিচে নামে

When you send data, each layer adds its own header in front. This is called encapsulation. The receiver removes the headers one by one, from bottom to top (decapsulation).

Data পাঠানোর সময় প্রতিটা layer সামনে নিজের একটা header যোগ করে। একে বলে encapsulation। Receiver নিচ থেকে উপরে এক এক করে header খুলে ফেলে (decapsulation)।

Application Data Transport (TCP) TCP hdr Data = Segment Network (IP) IP hdr TCP hdr Data = Packet Data Link Eth hdr IP hdr TCP hdr Data FCS = Frame Physical 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 ... = Bits
Encapsulation: each layer adds a header. Data → Segment → Packet → Frame → Bits. Encapsulation: প্রতিটা layer একটা header যোগ করে। Data → Segment → Packet → Frame → Bits।
Example: You open a web page. HTTP makes the request (Application). TCP adds ports and sequence numbers (Transport, makes a Segment). IP adds source and destination IP addresses (Network, makes a Packet). Ethernet adds MAC addresses (Data Link, makes a Frame). The wire carries the bits (Physical).
Example: আপনি একটা web page খুললেন। HTTP request বানায় (Application)। TCP port আর sequence number যোগ করে (Transport, Segment বানায়)। IP source আর destination IP address যোগ করে (Network, Packet বানায়)। Ethernet MAC address যোগ করে (Data Link, Frame বানায়)। তার দিয়ে bit যায় (Physical)।
Exam tip: BUET loves "which layer does X?" questions. Remember: ports → Transport, IP address / routing → Network, MAC address / framing → Data Link, bits / cables → Physical. Also memorize the PDU names: Data, Segment, Packet, Frame, Bit.
Exam tip: BUET-এ "X কাজটা কোন layer করে?" ধরনের প্রশ্ন খুব আসে। মনে রাখুন: port → Transport, IP address / routing → Network, MAC address / framing → Data Link, bit / cable → Physical। PDU-এর নামগুলোও মুখস্থ রাখুন: Data, Segment, Packet, Frame, Bit।

2. Ethernet and the Data Link Layer2. Ethernet এবং Data Link Layer

Network topologies: how we connect the machinesNetwork topology: machine গুলো কীভাবে জোড়া লাগাই

A topology is the shape of the network — the pattern in which we connect the devices. The five classic shapes:

  • Bus: one long shared cable; every device taps into it. Cheap, but if the main cable breaks, the whole network dies. Collisions are common.
  • Star: every device connects to one central hub or switch. Cheap and easy to add devices, but the hub is a single point of failure — if it dies, everything dies. This is what almost every LAN uses today.
  • Ring: each device connects to the next, forming a circle. Data travels one way (often with a token). One broken link can stop the ring (dual rings fix this).
  • Mesh: every device connects directly to every other device. A full mesh with \( n \) devices needs \( \frac{n(n-1)}{2} \) links. It is the most fault-tolerant — many paths exist — but the most expensive in cables and ports.
  • Hybrid: a mix of the above — for example, several star networks joined by a bus or a partial mesh backbone. Real large networks are hybrids.

Topology মানে network-এর আকৃতি — device গুলোকে আমরা কোন ছকে জোড়া লাগাই। পাঁচটা classic আকৃতি:

  • Bus: একটা লম্বা shared cable; সব device সেটাতে যুক্ত। সস্তা, কিন্তু মূল cable ছিঁড়লে পুরো network বন্ধ। Collision-ও বেশি হয়।
  • Star: সব device একটা central hub বা switch-এ যুক্ত। সস্তা, নতুন device যোগ করাও সহজ, কিন্তু hub হলো single point of failure — সে মরলে সব মরে। আজকের প্রায় সব LAN এটাই ব্যবহার করে।
  • Ring: প্রতিটা device পরেরটার সাথে যুক্ত, মিলে একটা বৃত্ত। Data এক দিকে ঘোরে (প্রায়ই token দিয়ে)। একটা link ভাঙলে ring থেমে যেতে পারে (dual ring এটা সামলায়)।
  • Mesh: প্রতিটা device সরাসরি বাকি সবার সাথে যুক্ত। \( n \)টা device-এর full mesh-এ লাগে \( \frac{n(n-1)}{2} \)টা link। এটা সবচেয়ে fault-tolerant — অনেক path থাকে — কিন্তু cable আর port-এর দিক থেকে সবচেয়ে খরুচে
  • Hybrid: উপরের গুলোর মিশ্রণ — যেমন কয়েকটা star network একটা bus বা partial mesh backbone দিয়ে জোড়া। বাস্তবের বড় network গুলো hybrid-ই হয়।
Star Hub n links, hub = single point of failure Mesh (full) n = 5 → 5(5−1)/2 = 10 links, most fault-tolerant
Star vs mesh. Star needs only n links but the hub is a single point of failure. Full mesh needs n(n−1)/2 links but survives many failures. Star vs mesh। Star-এ মাত্র nটা link লাগে কিন্তু hub হলো single point of failure। Full mesh-এ n(n−1)/2টা link লাগে কিন্তু অনেক failure-এও টিকে থাকে।
TopologyTopology Cabling costCabling খরচ Fault toleranceFault tolerance Single point of failureSingle point of failure ScalabilityScalability
Bus Very low (one cable)খুব কম (একটাই cable) Poorখারাপ Yes — the main cableআছে — মূল cable Poor (more devices = more collisions)খারাপ (device বাড়লে collision বাড়ে)
Star Low (n links)কম (nটা link) Good — one link down hurts one deviceভালো — একটা link গেলে একটাই device ভোগে Yes — the central hub/switchআছে — central hub/switch Good — just plug into the hubভালো — hub-এ লাগালেই হলো
Ring Low (n links)কম (nটা link) Poor — one break can stop the ringখারাপ — একটা ভাঙলেই ring থামতে পারে Yes — any link (unless dual ring)আছে — যেকোনো link (dual ring না হলে) Medium — adding a device breaks the ring brieflyমাঝারি — device যোগ করতে ring খুলতে হয়
Mesh Very high — n(n−1)/2 linksখুব বেশি — n(n−1)/2টা link Best — many alternate pathsসেরা — অনেক বিকল্প path Noনেই Poor — each new device needs n new linksখারাপ — নতুন device মানে nটা নতুন link
Hybrid Medium (depends on the mix)মাঝারি (মিশ্রণের উপর নির্ভর) Good (design choice)ভালো (design-এর উপর নির্ভর) Depends on designDesign-এর উপর নির্ভর Good — grow part by partভালো — অংশে অংশে বাড়ানো যায়
Example: Connect 6 offices in a full mesh. Links needed = \( \frac{6(6-1)}{2} = \frac{30}{2} = 15 \). As a star, the same 6 offices need only 6 links to one central site — but if that central site fails, all communication stops. In the mesh, any single office or link can fail and the rest still talk.
Example: 6টা office-কে full mesh-এ জুড়ুন। লাগবে \( \frac{6(6-1)}{2} = \frac{30}{2} = 15 \)টা link। Star হিসেবে একই 6টা office-এর লাগে মাত্র 6টা link, একটা central site-এ — কিন্তু সেই central site fail করলে সব যোগাযোগ বন্ধ। Mesh-এ যেকোনো একটা office বা link fail করলেও বাকিরা কথা বলতে পারে।
Exam note (asked April 2019): BUET asked to compare the characteristics of mesh vs star. The safe answer: mesh = \( n(n-1)/2 \) links, most fault-tolerant, no single point of failure, but expensive and hard to scale; star = only \( n \) links, cheap and easy to expand, but the central hub is a single point of failure.
Exam note (April 2019-এ এসেছে): BUET mesh vs star-এর characteristics তুলনা করতে বলেছিল। নিরাপদ উত্তর: mesh = \( n(n-1)/2 \)টা link, সবচেয়ে fault-tolerant, single point of failure নেই, কিন্তু খরুচে আর বড় করা কঠিন; star = মাত্র \( n \)টা link, সস্তা আর বাড়ানো সহজ, কিন্তু central hub-টাই single point of failure।

MAC addressMAC address

Every network card (NIC) has a MAC address. It is a 48-bit (6-byte) hardware address, written in hex like 00:1A:2B:3C:4D:5E. The first 24 bits are the OUI (vendor code, like Intel or Realtek). The last 24 bits are unique for that card. The special address FF:FF:FF:FF:FF:FF means broadcast — everyone on the local network receives it.

MAC works only inside the local network (LAN). IP address works across networks. A packet keeps the same IP addresses end to end, but the MAC addresses change at every router hop.

প্রতিটা network card (NIC)-এর একটা MAC address থাকে। এটা 48-bit (6-byte) hardware address, hex-এ লেখা হয়, যেমন 00:1A:2B:3C:4D:5E। প্রথম 24 bit হলো OUI (vendor code, যেমন Intel বা Realtek)। শেষ 24 bit ওই card-এর জন্য unique। বিশেষ address FF:FF:FF:FF:FF:FF মানে broadcast — local network-এর সবাই এটা পায়।

MAC শুধু local network (LAN)-এর ভিতরে কাজ করে। IP address কাজ করে network-এর বাইরেও। একটা packet-এর IP address শুরু থেকে শেষ পর্যন্ত একই থাকে, কিন্তু প্রতিটা router hop-এ MAC address বদলে যায়।

Ethernet frame (framing)Ethernet frame (framing)

The Data Link layer packs bits into frames. An Ethernet frame looks like this:

Data Link layer bit-গুলোকে frame-এ সাজায়। একটা Ethernet frame দেখতে এরকম:

FieldField SizeSize What it doesকী কাজ করে
Preamble + SFD8 bytesWakes up the receiver, marks frame startReceiver-কে জাগায়, frame-এর শুরু বোঝায়
Destination MAC6 bytesWho should receive the frameFrame-টা কে পাবে
Source MAC6 bytesWho sent the frameFrame-টা কে পাঠালো
Type / Length2 bytesWhat is inside (e.g., 0x0800 = IPv4, 0x0806 = ARP)ভিতরে কী আছে (যেমন 0x0800 = IPv4, 0x0806 = ARP)
Payload46–1500 bytesThe actual data (IP packet). Max 1500 = MTUআসল data (IP packet)। Max 1500 = MTU
FCS (CRC)4 bytesError check value (CRC-32)Error check value (CRC-32)
Note: Minimum Ethernet frame size is 64 bytes and maximum payload (MTU) is 1500 bytes. These two numbers are common exam facts.
Note: Ethernet frame-এর minimum size 64 bytes আর maximum payload (MTU) 1500 bytes। এই দুইটা সংখ্যা পরীক্ষায় প্রায়ই আসে।

CSMA/CD: sharing one wireCSMA/CD: এক তারে ভাগাভাগি

Old Ethernet used one shared wire. If two computers send at the same time, the signals crash — a collision. CSMA/CD (Carrier Sense Multiple Access with Collision Detection) handles this:

  1. Carrier Sense: listen first. If the wire is busy, wait.
  2. Multiple Access: many computers share the same wire.
  3. Collision Detection: while sending, keep listening. If a collision is heard, stop, send a short jam signal, wait a random time (binary exponential backoff), then try again.

Modern switched full-duplex Ethernet has no collisions, so CSMA/CD is mostly history — but it is still a favorite exam topic. Wi-Fi uses a cousin called CSMA/CA (Collision Avoidance), because radios cannot detect collisions while sending.

পুরনো Ethernet একটা shared wire ব্যবহার করত। দুইটা computer একসাথে পাঠালে signal-এ ধাক্কা লাগে — একে বলে collisionCSMA/CD (Carrier Sense Multiple Access with Collision Detection) এটা সামলায়:

  1. Carrier Sense: আগে শুনুন। Wire busy থাকলে অপেক্ষা করুন।
  2. Multiple Access: অনেক computer একই wire ভাগ করে ব্যবহার করে।
  3. Collision Detection: পাঠানোর সময়ও শুনতে থাকুন। Collision শুনলে থামুন, একটা ছোট jam signal পাঠান, random সময় অপেক্ষা করুন (binary exponential backoff), তারপর আবার চেষ্টা করুন।

আধুনিক switched full-duplex Ethernet-এ collision হয় না, তাই CSMA/CD এখন প্রায় ইতিহাস — কিন্তু পরীক্ষায় এখনো প্রিয় topic। Wi-Fi ব্যবহার করে এর কাছের জিনিস CSMA/CA (Collision Avoidance), কারণ radio পাঠানোর সময় collision detect করতে পারে না।

Transmission Modes: Simplex, Half-Duplex, Full-DuplexTransmission Mode: Simplex, Half-Duplex, Full-Duplex

A link can carry data in three different ways. This is called the transmission mode (or communication mode):

  • Simplex: data flows in one direction only, forever. The receiver can never talk back. Examples: keyboard → computer, broadcast radio, TV broadcast.
  • Half-duplex: data can flow in both directions, but only one at a time. The two sides take turns. Examples: walkie-talkie ("over!"), classic shared Ethernet with CSMA/CD.
  • Full-duplex: data flows in both directions at the same time. Examples: a phone call, modern switched Ethernet (one pair of wires to send, one to receive).

একটা link তিন রকমভাবে data বহন করতে পারে। একে বলে transmission mode (বা communication mode):

  • Simplex: data সবসময় শুধু এক দিকে যায়। Receiver কখনো উত্তর দিতে পারে না। Example: keyboard → computer, broadcast radio, TV broadcast।
  • Half-duplex: data দুই দিকেই যেতে পারে, কিন্তু একসাথে একটাই। দুই পক্ষ পালা করে কথা বলে। Example: walkie-talkie ("over!"), CSMA/CD-ওয়ালা পুরনো shared Ethernet।
  • Full-duplex: data একই সময়ে দুই দিকেই যায়। Example: phone call, আধুনিক switched Ethernet (পাঠানোর জন্য এক জোড়া তার, নেওয়ার জন্য আরেক জোড়া)।
ModeMode Directionদিক Both sides at once?দুই পক্ষ একসাথে? ExamplesExample
Simplex One way onlyশুধু এক দিকে No — one side never sendsনা — এক পক্ষ কখনোই পাঠায় না Keyboard, broadcast radio/TVKeyboard, broadcast radio/TV
Half-duplex Both ways, one at a timeদুই দিকে, একবারে একটা No — they take turnsনা — পালা করে Walkie-talkie, old CSMA/CD EthernetWalkie-talkie, পুরনো CSMA/CD Ethernet
Full-duplex Both ways, same timeদুই দিকে, একই সময়ে Yesহ্যাঁ Phone call, modern switched EthernetPhone call, আধুনিক switched Ethernet
Exam favorite: modern switches give every device its own full-duplex link, so two directions never fight for the wire — no collisions are possible. That is exactly why CSMA/CD became obsolete. "Which mode is a walkie-talkie?" and "why does full-duplex kill CSMA/CD?" are classic questions.
Exam favorite: আধুনিক switch প্রতিটা device-কে নিজস্ব full-duplex link দেয়, তাই দুই দিকের data কখনো তারের জন্য লড়াই করে না — collision হওয়াই সম্ভব না। ঠিক এই কারণেই CSMA/CD obsolete হয়ে গেছে। "Walkie-talkie কোন mode?" আর "full-duplex কেন CSMA/CD-কে বাদ দিল?" — এগুলো classic প্রশ্ন।

Hub vs Switch vs RouterHub vs Switch vs Router

Hub Switch Router
OSI layerOSI layer 1 (Physical)2 (Data Link)3 (Network)
Decides usingকী দেখে সিদ্ধান্ত নেয় Nothing — repeats to all portsকিছুই না — সব port-এ পাঠিয়ে দেয় MAC address IP address
Collision domainsCollision domain One big one (bad)সব মিলে একটাই (খারাপ) One per portপ্রতি port-এ একটা One per portপ্রতি port-এ একটা
Broadcast domainsBroadcast domain Oneএকটা Oneএকটা Splits them — one per interfaceভাগ করে — প্রতি interface-এ একটা
Smart?বুদ্ধিমান? No, just an electric repeaterনা, শুধু electric repeater Learns a MAC tableMAC table শিখে নেয় Keeps a routing tableRouting table রাখে

ARP: finding a MAC from an IPARP: IP থেকে MAC খুঁজে বের করা

ARP (Address Resolution Protocol) answers one question: "I know your IP. What is your MAC?" It is needed because frames need MAC addresses, but programs only know IP addresses.

ARP (Address Resolution Protocol) একটাই প্রশ্নের উত্তর দেয়: "তোমার IP জানি। তোমার MAC কী?" এটা দরকার কারণ frame-এর MAC address লাগে, কিন্তু program শুধু IP address জানে।

Example (step by step): PC-A (192.168.1.10) wants to send to PC-B (192.168.1.20) on the same LAN.
  1. PC-A checks its ARP cache. No entry for 192.168.1.20.
  2. PC-A sends an ARP Request as a broadcast (dest MAC = FF:FF:FF:FF:FF:FF): "Who has 192.168.1.20? Tell 192.168.1.10."
  3. Every device on the LAN receives it. Only PC-B answers.
  4. PC-B sends an ARP Reply directly (unicast) to PC-A: "192.168.1.20 is at 08:00:27:AB:CD:EF."
  5. PC-A saves this in its ARP cache and now sends the real frame to that MAC.
Key pattern: Request = broadcast, Reply = unicast.
Example (ধাপে ধাপে): একই LAN-এ PC-A (192.168.1.10) PC-B (192.168.1.20)-কে data পাঠাতে চায়।
  1. PC-A তার ARP cache দেখে। 192.168.1.20-এর কোনো entry নেই।
  2. PC-A একটা ARP Request broadcast করে (dest MAC = FF:FF:FF:FF:FF:FF): "192.168.1.20 কার? 192.168.1.10-কে জানাও।"
  3. LAN-এর সব device এটা পায়। শুধু PC-B উত্তর দেয়।
  4. PC-B সরাসরি (unicast) PC-A-কে ARP Reply পাঠায়: "192.168.1.20 আছে 08:00:27:AB:CD:EF-এ।"
  5. PC-A এটা ARP cache-এ রেখে দেয়, এবং এখন আসল frame ওই MAC-এ পাঠায়।
মূল pattern: Request = broadcast, Reply = unicast

Error detection: parity, checksum, CRCError detection: parity, checksum, CRC

Bits can flip during travel. Error detection adds extra bits so the receiver can notice damage.

  • Parity bit: add 1 bit so the total number of 1s is even (even parity) or odd (odd parity). Very cheap, but it misses errors when 2 bits flip.
  • Checksum: add up the data words, take the 1's complement of the sum, send it along. The receiver adds everything; the result should be all 1s. Used by IP, TCP, UDP.
  • CRC (Cyclic Redundancy Check): treat bits as a polynomial, divide by a generator using XOR, and append the remainder. Very strong — catches burst errors. Used by Ethernet (FCS).

চলার পথে bit উল্টে যেতে পারে। Error detection বাড়তি কিছু bit যোগ করে, যাতে receiver ক্ষতিটা ধরতে পারে।

  • Parity bit: 1টা bit যোগ করা হয় যাতে মোট 1-এর সংখ্যা even হয় (even parity) বা odd হয় (odd parity)। খুব সস্তা, কিন্তু 2টা bit উল্টালে ধরতে পারে না।
  • Checksum: data word-গুলো যোগ করে, sum-এর 1's complement নিয়ে সাথে পাঠানো হয়। Receiver সব যোগ করে; ফলাফল সব 1 হওয়ার কথা। IP, TCP, UDP এটা ব্যবহার করে।
  • CRC (Cyclic Redundancy Check): bit-গুলোকে polynomial ধরে, XOR দিয়ে একটা generator দিয়ে ভাগ করা হয়, আর remainder-টা শেষে জুড়ে দেওয়া হয়। খুব শক্তিশালী — burst error ধরে ফেলে। Ethernet (FCS) এটা ব্যবহার করে।
Example (even parity): Data = 1011001. Number of 1s = 4 (already even). So parity bit = 0. We send 10110010. If data were 1011000 (three 1s, odd), parity bit = 1 to make the count even.
Example (even parity): Data = 1011001। 1-এর সংখ্যা = 4 (এমনিতেই even)। তাই parity bit = 0। আমরা পাঠাই 10110010। Data যদি হতো 1011000 (তিনটা 1, odd), তাহলে parity bit = 1, যাতে সংখ্যাটা even হয়।
Example (1's complement checksum, 4-bit words): Send words 1001 and 1100.
  1. Add: 1001 + 1100 = 1 0101. Carry (1) wraps around: 0101 + 1 = 0110.
  2. Checksum = 1's complement of 0110 = 1001. Send it with the data.
  3. Receiver adds all three: 1001 + 1100 + 1001 = ... after wraparound the sum becomes 1111 (all 1s) → no error detected.
Example (1's complement checksum, 4-bit word): পাঠাতে হবে 1001 আর 1100
  1. যোগ: 1001 + 1100 = 1 0101। Carry (1) ঘুরে এসে যোগ হয়: 0101 + 1 = 0110
  2. Checksum = 0110-এর 1's complement = 1001। Data-র সাথে এটাও পাঠান।
  3. Receiver তিনটাই যোগ করে: 1001 + 1100 + 1001 = ... wraparound-এর পরে sum হয় 1111 (সব 1) → কোনো error ধরা পড়েনি।
Example (CRC, worked bit by bit): Data = 1101, Generator = 1011 (4 bits → CRC will be 3 bits).
  1. Append 3 zeros to the data: 1101000.
  2. Divide by 1011 using XOR (no borrow, just XOR):
1101000
1011      <- XOR with first 4 bits (1101)
----
0110 0    -> bring next bit: 1100
 1011     <- XOR
 ----
 0111 0   -> bring next bit: 1110
  1011    <- XOR
  ----
  0101 0  -> bring next bit: 1010
   1011   <- XOR
   ----
   0001   -> remainder = 001
  1. CRC = 001. Transmit 1101001.
  2. The receiver divides 1101001 by 1011. Remainder 0 → no error. Non-zero remainder → error.
Example (CRC, bit ধরে ধরে): Data = 1101, Generator = 1011 (4 bit → CRC হবে 3 bit)।
  1. Data-র শেষে 3টা zero বসান: 1101000
  2. XOR দিয়ে 1011 দিয়ে ভাগ করুন (borrow নেই, শুধু XOR):
1101000
1011      <- প্রথম 4 bit (1101)-এর সাথে XOR
----
0110 0    -> পরের bit নামান: 1100
 1011     <- XOR
 ----
 0111 0   -> পরের bit নামান: 1110
  1011    <- XOR
  ----
  0101 0  -> পরের bit নামান: 1010
   1011   <- XOR
   ----
   0001   -> remainder = 001
  1. CRC = 001। পাঠান 1101001
  2. Receiver 1101001-কে 1011 দিয়ে ভাগ করে। Remainder 0 → error নেই। Remainder non-zero → error আছে।
Exam tip: For CRC with a generator of \( n \) bits, append \( n-1 \) zeros, and the CRC is \( n-1 \) bits long. Parity detects any odd number of bit errors, but never an even number.
Exam tip: Generator যদি \( n \) bit-এর হয়, তাহলে \( n-1 \)টা zero যোগ করতে হয়, আর CRC হয় \( n-1 \) bit লম্বা। Parity যেকোনো odd সংখ্যক bit error ধরতে পারে, কিন্তু even সংখ্যক ধরতে পারে না।

3. IP Addressing and Subnetting3. IP Addressing এবং Subnetting

IPv4 basicsIPv4 basics

An IPv4 address is a 32-bit number. We write it as 4 decimal numbers (octets), each 0–255, separated by dots. Example: 192.168.10.5.

In binary: 11000000.10101000.00001010.00000101. Every address has two parts: a network part (which network) and a host part (which machine inside that network). The subnet mask tells where the split is.

IPv4 address হলো একটা 32-bit সংখ্যা। আমরা এটা 4টা decimal সংখ্যা (octet) দিয়ে লিখি, প্রতিটা 0–255, মাঝে dot। যেমন: 192.168.10.5

Binary-তে: 11000000.10101000.00001010.00000101। প্রতিটা address-এর দুইটা অংশ: network part (কোন network) আর host part (ওই network-এর ভিতরে কোন machine)। ভাগটা কোথায়, সেটা বলে subnet mask

IPv4 packet header diagram showing version, header length, TTL, protocol, source and destination addresses
The IPv4 packet header. For the exam, know: Version, TTL, Protocol, Source IP, Destination IP, and Header Checksum. IPv4 packet header। পরীক্ষার জন্য জানুন: Version, TTL, Protocol, Source IP, Destination IP আর Header Checksum।

Address classesAddress class

Class First octet rangeপ্রথম octet-এর range Default maskDefault mask Useব্যবহার
A1 – 126255.0.0.0 (/8)Huge networksবিশাল network
B128 – 191255.255.0.0 (/16)Medium networksমাঝারি network
C192 – 223255.255.255.0 (/24)Small networksছোট network
D224 – 239Multicast
E240 – 255Reserved (research)Reserved (research)

Special addresses to memorize:

  • Private ranges (not routable on the Internet): 10.0.0.0/8, 172.16.0.0/12 (172.16.x.x – 172.31.x.x), 192.168.0.0/16.
  • Loopback: 127.0.0.1 (your own machine; the whole 127.x.x.x block).
  • APIPA / link-local: 169.254.x.x (when DHCP fails).
  • In any subnet: all host bits 0 = network address, all host bits 1 = broadcast address. Neither can be given to a host.

মুখস্থ রাখার মতো special address:

  • Private range (Internet-এ route হয় না): 10.0.0.0/8, 172.16.0.0/12 (172.16.x.x – 172.31.x.x), 192.168.0.0/16
  • Loopback: 127.0.0.1 (আপনার নিজের machine; পুরো 127.x.x.x block)।
  • APIPA / link-local: 169.254.x.x (DHCP fail করলে)।
  • যেকোনো subnet-এ: সব host bit 0 = network address, সব host bit 1 = broadcast address। এই দুইটা কোনো host-কে দেওয়া যায় না।

CIDR and the subnet maskCIDR এবং subnet mask

CIDR notation writes the mask as /n — the number of network bits. Example: /26 means the first 26 bits are network, the last \( 32-26=6 \) bits are host.

Mask /26 in binary: 11111111.11111111.11111111.11000000 = 255.255.255.192.

CIDR notation-এ mask লেখা হয় /n হিসেবে — মানে network bit-এর সংখ্যা। যেমন: /26 মানে প্রথম 26 bit হলো network, শেষ \( 32-26=6 \) bit হলো host।

/26 mask binary-তে: 11111111.11111111.11111111.11000000 = 255.255.255.192

\[ \text{Usable hosts} = 2^{h} - 2 \qquad \text{Subnets from } s \text{ borrowed bits} = 2^{s} \]

Here \( h \) = number of host bits. We subtract 2 for the network address and the broadcast address.

এখানে \( h \) = host bit-এর সংখ্যা। Network address আর broadcast address-এর জন্য 2 বাদ দিতে হয়।

Worked example 1: analyze 192.168.10.0/26Worked example 1: 192.168.10.0/26 বিশ্লেষণ

Example: For 192.168.10.0/26, find the mask, network address, broadcast address, and usable host range.
  1. Mask: /26 → 26 ones: 255.255.255.192. Host bits \( h = 32-26 = 6 \).
  2. Block size: \( 2^{6} = 64 \). So subnets start every 64 in the last octet: .0, .64, .128, .192.
  3. Binary check of the last octet (first 2 bits are network, last 6 are host):
    IP   .0    = 00 000000
    Mask .192  = 11 000000
    AND        = 00 000000  -> network = 192.168.10.0
  4. Broadcast: set all 6 host bits to 1: 00 111111 = 63 → 192.168.10.63.
  5. Usable hosts: \( 2^{6} - 2 = 62 \), from 192.168.10.1 to 192.168.10.62.
Example: 192.168.10.0/26-এর জন্য mask, network address, broadcast address আর usable host range বের করুন।
  1. Mask: /26 → 26টা 1: 255.255.255.192। Host bit \( h = 32-26 = 6 \)।
  2. Block size: \( 2^{6} = 64 \)। তাই শেষ octet-এ প্রতি 64 পর পর subnet শুরু হয়: .0, .64, .128, .192।
  3. শেষ octet-এর binary check (প্রথম 2 bit network, শেষ 6 bit host):
    IP   .0    = 00 000000
    Mask .192  = 11 000000
    AND        = 00 000000  -> network = 192.168.10.0
  4. Broadcast: সব 6টা host bit 1 করুন: 00 111111 = 63 → 192.168.10.63
  5. Usable host: \( 2^{6} - 2 = 62 \), 192.168.10.1 থেকে 192.168.10.62 পর্যন্ত।

Worked example 2: divide a /24 into 4 subnets (BUET favorite)Worked example 2: একটা /24-কে 4টা subnet-এ ভাগ (BUET-এর প্রিয়)

Example: Divide 200.10.20.0/24 into 4 equal subnets.
  1. How many bits to borrow? We need 4 subnets. \( 2^{s} \ge 4 \Rightarrow s = 2 \). New prefix = 24 + 2 = /26, mask 255.255.255.192.
  2. Host bits left: \( h = 32 - 26 = 6 \) → each subnet has \( 2^{6}-2 = 62 \) usable hosts.
  3. Write the borrowed 2 bits in the last octet (bold part is the subnet number):
    Subnet 0: 00000000 = .0
    Subnet 1: 01000000 = .64
    Subnet 2: 10000000 = .128
    Subnet 3: 11000000 = .192
SubnetNetworkFirst hostLast hostBroadcast
1200.10.20.0/26.1.62.63
2200.10.20.64/26.65.126.127
3200.10.20.128/26.129.190.191
4200.10.20.192/26.193.254.255
Example: 200.10.20.0/24-কে 4টা সমান subnet-এ ভাগ করুন।
  1. কয়টা bit ধার নিতে হবে? 4টা subnet দরকার। \( 2^{s} \ge 4 \Rightarrow s = 2 \)। নতুন prefix = 24 + 2 = /26, mask 255.255.255.192
  2. Host bit বাকি: \( h = 32 - 26 = 6 \) → প্রতিটা subnet-এ \( 2^{6}-2 = 62 \)টা usable host।
  3. শেষ octet-এ ধার নেওয়া 2 bit লিখুন (bold অংশটা subnet number):
    Subnet 0: 00000000 = .0
    Subnet 1: 01000000 = .64
    Subnet 2: 10000000 = .128
    Subnet 3: 11000000 = .192
SubnetNetworkFirst hostLast hostBroadcast
1200.10.20.0/26.1.62.63
2200.10.20.64/26.65.126.127
3200.10.20.128/26.129.190.191
4200.10.20.192/26.193.254.255

Worked example 3: which subnet does an IP belong to?Worked example 3: একটা IP কোন subnet-এ পড়ে?

Example: Which network does 172.16.77.10/20 belong to?
  1. /20 = 16 bits (first two octets) + 4 bits of the third octet. Mask = 255.255.240.0.
  2. Only the third octet needs binary work. 77 = 01001101.
  3. AND with the mask octet 240 = 11110000:
    77   = 0100 1101
    240  = 1111 0000
    AND  = 0100 0000 = 64
  4. Network = 172.16.64.0/20.
  5. Broadcast: set the 12 host bits to 1 → third octet 0100 1111 = 79, fourth octet 255 → 172.16.79.255.
  6. Host range: 172.16.64.1172.16.79.254. So yes, 172.16.77.10 is inside.
Example: 172.16.77.10/20 কোন network-এ পড়ে?
  1. /20 = 16 bit (প্রথম দুই octet) + তৃতীয় octet-এর 4 bit। Mask = 255.255.240.0
  2. শুধু তৃতীয় octet-এ binary-র কাজ লাগবে। 77 = 01001101
  3. Mask-এর octet 240 = 11110000-এর সাথে AND করুন:
    77   = 0100 1101
    240  = 1111 0000
    AND  = 0100 0000 = 64
  4. Network = 172.16.64.0/20
  5. Broadcast: 12টা host bit 1 করুন → তৃতীয় octet 0100 1111 = 79, চতুর্থ octet 255 → 172.16.79.255
  6. Host range: 172.16.64.1172.16.79.254। তাই হ্যাঁ, 172.16.77.10 এর ভিতরে আছে।

Worked example 4: host 192.168.10.45/27 (asked April 2024)Worked example 4: host 192.168.10.45/27 (April 2024-এ এসেছে)

Example (real BUET question, April 2024): A host has IP 192.168.10.45/27. Find the subnet (network IP), the broadcast address, and the usable host range.
  1. Mask: /27 → 27 ones → 255.255.255.224. Host bits \( h = 32 - 27 = 5 \).
  2. Block size: \( 2^{5} = 32 \) (or 256 − 224 = 32). Subnets start at .0, .32, .64, .96, ...
  3. Binary of the last octet (first 3 bits network, last 5 bits host). 45 = 32 + 8 + 4 + 1:
    IP   .45   = 001 01101
    Mask .224  = 111 00000
    AND        = 001 00000 = 32  -> network = 192.168.10.32
  4. Network IP = 192.168.10.32/27. (Quick check: the biggest multiple of 32 that is ≤ 45 is 32.)
  5. Broadcast: set all 5 host bits to 1 → 001 11111 = 32 + 31 = 63 → 192.168.10.63.
  6. Usable host range: 192.168.10.33 to 192.168.10.62, which is \( 2^{5} - 2 = 30 \) hosts. So .45 is a valid host inside this subnet.
Example (আসল BUET প্রশ্ন, April 2024): একটা host-এর IP 192.168.10.45/27। এর subnet (network IP), broadcast address আর usable host range বের করুন।
  1. Mask: /27 → 27টা 1 → 255.255.255.224। Host bit \( h = 32 - 27 = 5 \)।
  2. Block size: \( 2^{5} = 32 \) (বা 256 − 224 = 32)। Subnet শুরু হয় .0, .32, .64, .96, ...-এ।
  3. শেষ octet-এর binary (প্রথম 3 bit network, শেষ 5 bit host)। 45 = 32 + 8 + 4 + 1:
    IP   .45   = 001 01101
    Mask .224  = 111 00000
    AND        = 001 00000 = 32  -> network = 192.168.10.32
  4. Network IP = 192.168.10.32/27। (দ্রুত check: 45-এর চেয়ে ছোট বা সমান, 32-এর সবচেয়ে বড় গুণিতক হলো 32।)
  5. Broadcast: সব 5টা host bit 1 করুন → 001 11111 = 32 + 31 = 63 → 192.168.10.63
  6. Usable host range: 192.168.10.33 থেকে 192.168.10.62, মানে \( 2^{5} - 2 = 30 \)টা host। তাই .45 এই subnet-এর একটা valid host।

Worked example 5: what mask gives 512 subnets? (asked April 2019)Worked example 5: কোন mask 512টা subnet দেয়? (April 2019-এ এসেছে)

Example (real BUET question, April 2019): You have a Class B network (a /16, e.g. 172.16.0.0/16). What subnet mask do you need to create 512 subnets?
  1. How many bits to borrow? We need \( 2^{s} \ge 512 \). Since \( 2^{9} = 512 \), borrow exactly s = 9 bits.
  2. New prefix: 16 + 9 = /25.
  3. Write the mask: /25 = 8 + 8 + 8 + 1 ones:
    11111111.11111111.11111111.10000000
       255  .  255  .  255  .  128
    So the mask is 255.255.255.128.
  4. Check the hosts left: \( h = 32 - 25 = 7 \) → \( 2^{7} - 2 = 126 \) usable hosts in each of the 512 subnets.
General recipe: subnets needed → \( s = \lceil \log_2(\text{subnets}) \rceil \) → new prefix = old prefix + s → write s extra ones into the mask.
Example (আসল BUET প্রশ্ন, April 2019): আপনার কাছে একটা Class B network আছে (একটা /16, যেমন 172.16.0.0/16)। 512টা subnet বানাতে কোন subnet mask লাগবে?
  1. কয়টা bit ধার নিতে হবে? দরকার \( 2^{s} \ge 512 \)। যেহেতু \( 2^{9} = 512 \), ঠিক s = 9টা bit ধার নিন।
  2. নতুন prefix: 16 + 9 = /25
  3. Mask লিখুন: /25 = 8 + 8 + 8 + 1টা 1:
    11111111.11111111.11111111.10000000
       255  .  255  .  255  .  128
    তাহলে mask হলো 255.255.255.128
  4. বাকি host check করুন: \( h = 32 - 25 = 7 \) → 512টা subnet-এর প্রতিটায় \( 2^{7} - 2 = 126 \)টা usable host।
সাধারণ নিয়ম: কয়টা subnet দরকার → \( s = \lceil \log_2(\text{subnet সংখ্যা}) \rceil \) → নতুন prefix = পুরনো prefix + s → mask-এ sটা বাড়তি 1 বসান।
Exam tip: Fast method — block size = 256 − (mask octet). For mask .192, block = 64: subnets at 0, 64, 128, 192. The answer network is the biggest multiple of the block size that is ≤ your IP's octet. Broadcast = next network − 1. Always remember: usable hosts \( = 2^{h} - 2 \).
Exam tip: দ্রুত পদ্ধতি — block size = 256 − (mask-এর octet)। Mask .192 হলে block = 64: subnet গুলো 0, 64, 128, 192-এ। আপনার IP-র octet-এর চেয়ে ছোট বা সমান, block size-এর সবচেয়ে বড় গুণিতকটাই হলো network। Broadcast = পরের network − 1। সবসময় মনে রাখুন: usable host \( = 2^{h} - 2 \)।

IPv6 in briefসংক্ষেপে IPv6

  • 128-bit address, written as 8 groups of 4 hex digits: 2001:0db8:0000:0000:0000:0000:0000:0001.
  • Shorten it: drop leading zeros, and replace one run of all-zero groups with ::2001:db8::1.
  • No broadcast in IPv6 — it uses multicast and anycast instead. No NAT needed (huge address space). Header is simpler, and there is no header checksum.
  • IPv4 has about \( 2^{32} \approx 4.3 \) billion addresses; IPv6 has \( 2^{128} \) — practically unlimited.
  • 128-bit address, 8টা group-এ 4টা করে hex digit দিয়ে লেখা হয়: 2001:0db8:0000:0000:0000:0000:0000:0001
  • ছোট করার নিয়ম: শুরুর zero বাদ দিন, আর একটানা all-zero group গুলোকে একবার :: দিয়ে বদলান → 2001:db8::1
  • IPv6-এ broadcast নেই — বদলে multicast আর anycast আছে। NAT লাগে না (address অনেক বেশি)। Header সহজ, আর কোনো header checksum নেই।
  • IPv4-এ প্রায় \( 2^{32} \approx 4.3 \) billion address; IPv6-এ \( 2^{128} \) — কার্যত সীমাহীন।

4. Routing4. Routing

The routing tableRouting table

A router moves packets between networks. For every packet, it looks at the destination IP and checks its routing table: "for this network, send out of this interface, to this next hop." If nothing matches, it uses the default route 0.0.0.0/0.

Router এক network থেকে আরেক network-এ packet পাঠায়। প্রতিটা packet-এর জন্য সে destination IP দেখে আর নিজের routing table মেলায়: "এই network-এর জন্য এই interface দিয়ে, এই next hop-এ পাঠাও।" কিছু না মিললে সে default route 0.0.0.0/0 ব্যবহার করে।

DestinationDestination Next hopNext hop InterfaceInterface
192.168.1.0/24directly connecteddirectly connectedeth0
10.0.0.0/8192.168.1.254eth0
0.0.0.0/0 (default)(default)203.0.113.1eth1

Longest prefix matchLongest prefix match

If several routes match a destination, the router picks the one with the longest prefix (the most specific route).

একটা destination-এর সাথে একাধিক route মিললে, router সবচেয়ে লম্বা prefix-ওয়ালা route-টা নেয় (সবচেয়ে specific route)।

Example: A packet goes to 192.168.10.130. The table has:
  • Route A: 192.168.10.0/24 → next hop R1
  • Route B: 192.168.10.128/26 → next hop R2
  • Route C: 0.0.0.0/0 → next hop R3
All three match (130 is inside .128–.191, so B matches too). The longest prefix is /26 → the packet goes to R2.
Example: একটা packet যাবে 192.168.10.130-এ। Table-এ আছে:
  • Route A: 192.168.10.0/24 → next hop R1
  • Route B: 192.168.10.128/26 → next hop R2
  • Route C: 0.0.0.0/0 → next hop R3
তিনটাই মেলে (130 আছে .128–.191-এর ভিতরে, তাই B-ও মেলে)। সবচেয়ে লম্বা prefix হলো /26 → packet যাবে R2-তে।

Static vs dynamic routingStatic vs dynamic routing

  • Static routing: a human types the routes by hand. Simple, safe, no extra traffic — but does not adapt when a link fails. Good for tiny networks.
  • Dynamic routing: routers run a protocol (RIP, OSPF, BGP) and share routes with each other. They adapt automatically when the network changes.
  • Static routing: মানুষ হাতে route লিখে দেয়। সহজ, নিরাপদ, বাড়তি traffic নেই — কিন্তু link fail করলে নিজে বদলাতে পারে না। ছোট network-এর জন্য ভালো।
  • Dynamic routing: router-রা একটা protocol চালায় (RIP, OSPF, BGP) আর নিজেদের মধ্যে route শেয়ার করে। Network বদলালে এরা নিজে থেকেই মানিয়ে নেয়।

Distance vector vs link stateDistance vector vs link state

Distance Vector Link State
Ideaমূল ধারণা "Routing by rumor" — each router tells neighbors its whole table"Routing by rumor" — প্রতিটা router প্রতিবেশীদের নিজের পুরো table বলে Every router learns the full map, then computes paths itselfপ্রতিটা router পুরো map শিখে, তারপর নিজে path হিসাব করে
AlgorithmAlgorithm Bellman–Ford Dijkstra (shortest path)
Knowsকী জানে Only distances via neighborsশুধু প্রতিবেশী হয়ে distance Full network topologyপুরো network topology
UpdatesUpdate Periodic, to neighbors onlyনিয়মিত, শুধু প্রতিবেশীদের Only on change, flooded to allশুধু বদল হলে, সবার কাছে flood করা হয়
Problemসমস্যা Slow convergence, count-to-infinityধীরে converge করে, count-to-infinity More CPU and memory neededবেশি CPU আর memory লাগে
Exampleউদাহরণ RIP OSPF

One-liners to memorize:

  • RIP: distance vector, metric = hop count, max 15 hops (16 = unreachable), updates every 30 seconds.
  • OSPF: link state, metric = cost (based on bandwidth), uses Dijkstra, scales with areas, converges fast.
  • BGP: path vector protocol between autonomous systems (AS) — the routing protocol of the Internet backbone. Chooses routes by policy, not just distance.

মুখস্থ রাখার মতো one-liner:

  • RIP: distance vector, metric = hop count, max 15 hop (16 = unreachable), প্রতি 30 second-এ update।
  • OSPF: link state, metric = cost (bandwidth-এর ভিত্তিতে), Dijkstra ব্যবহার করে, area দিয়ে বড় হয়, দ্রুত converge করে।
  • BGP: autonomous system (AS)-দের মাঝখানের path vector protocol — Internet backbone-এর routing protocol। শুধু দূরত্ব না, policy দেখে route বাছে।

NAT: many private IPs behind one public IPNAT: এক public IP-র পেছনে অনেক private IP

NAT (Network Address Translation) lets a whole private network share one public IP. The router rewrites addresses (and ports, in PAT/NAPT) as packets pass through, and keeps a translation table to send replies back to the right device. This is why your home Wi-Fi with 10 devices needs only one public IP. Cost: outside hosts cannot start a connection to an inside host directly.

NAT (Network Address Translation) একটা পুরো private network-কে একটাই public IP ভাগ করে ব্যবহার করতে দেয়। Packet যাওয়ার সময় router address (আর PAT/NAPT-এ port-ও) বদলে দেয়, আর একটা translation table রাখে যাতে reply ঠিক device-এ ফেরত যায়। এজন্যই বাসার Wi-Fi-এ 10টা device থাকলেও একটা public IP-তেই চলে। অসুবিধা: বাইরের কেউ সরাসরি ভিতরের host-এর সাথে connection শুরু করতে পারে না।

Example: Laptop 192.168.0.5:51000 opens a website. The NAT router replaces the source with its public IP 203.0.113.7:62001 and notes the mapping 192.168.0.5:51000 ↔ 203.0.113.7:62001. When the reply arrives at port 62001, the router translates it back and delivers it to the laptop.
Example: Laptop 192.168.0.5:51000 একটা website খোলে। NAT router source বদলে নিজের public IP 203.0.113.7:62001 বসায়, আর mapping-টা লিখে রাখে: 192.168.0.5:51000 ↔ 203.0.113.7:62001। Port 62001-এ reply এলে router সেটা উল্টো translate করে laptop-এ পৌঁছে দেয়।

NAT vs PAT: what is the difference?NAT vs PAT: পার্থক্য কী?

People say "NAT" for everything, but the exam wants the exact difference:

  • NAT (static / basic NAT): a one-to-one mapping. Each private IP gets its own public IP. Only IP addresses are rewritten; ports are not touched. If you have 10 inside hosts, you need 10 public IPs. Used when a server inside must always look like one fixed public address.
  • PAT (Port Address Translation, also called NAT overload or NAPT): a many-to-one mapping. Many private IPs share one public IP. The router tells the connections apart using port numbers — it rewrites both the IP and the source port. This is what every home router actually does.

Memory trick: NAT = address for address. PAT = port makes it possible.

সবাই সব কিছুকেই "NAT" বলে, কিন্তু পরীক্ষা চায় exact পার্থক্য:

  • NAT (static / basic NAT): one-to-one mapping। প্রতিটা private IP-র জন্য আলাদা একটা public IP। শুধু IP address বদলায়; port-এ হাত দেয় না। ভিতরে 10টা host থাকলে 10টা public IP লাগবে। ভিতরের কোনো server-কে সবসময় একটা fixed public address দেখাতে হলে এটা ব্যবহার হয়।
  • PAT (Port Address Translation, যাকে NAT overload বা NAPT-ও বলে): many-to-one mapping। অনেক private IP মিলে একটাই public IP ভাগ করে। Router connection গুলো আলাদা করে চেনে port number দিয়ে — সে IP আর source port দুটোই বদলে দেয়। বাসার প্রতিটা router আসলে এটাই করে।

মনে রাখার কৌশল: NAT = address-এর বদলে address। PAT = port-ই সব সম্ভব করে।

Example (PAT translation table): Two inside hosts browse at the same time, sharing one public IP 203.0.113.7:
Inside (private)Translated (public)Destination
192.168.0.5:51000203.0.113.7:6200193.184.216.34:443
192.168.0.9:51000203.0.113.7:6200293.184.216.34:443
Both hosts even picked the same source port (51000) and the same website — no problem. The router gave them different public ports (62001 vs 62002), so when replies come back to port 62001 or 62002, it knows exactly which inside host gets which packet. With basic one-to-one NAT this would need two public IPs.
Example (PAT translation table): ভিতরের দুইটা host একসাথে browse করছে, একটা public IP 203.0.113.7 ভাগ করে:
Inside (private)Translated (public)Destination
192.168.0.5:51000203.0.113.7:6200193.184.216.34:443
192.168.0.9:51000203.0.113.7:6200293.184.216.34:443
দুই host একই source port (51000) আর একই website-ও নিয়েছে — কোনো সমস্যা নেই। Router তাদের আলাদা public port দিয়েছে (62001 vs 62002), তাই port 62001 বা 62002-এ reply এলে সে ঠিক জানে কোন packet ভিতরের কোন host-এর। সাধারণ one-to-one NAT হলে এখানে দুইটা public IP লাগত।
Exam note (asked October 2017): BUET asked the difference between NAT and PAT. Answer in one line: NAT maps one private IP to one public IP (address only); PAT maps many private IPs to one public IP by also translating port numbers. Bonus point: PAT is why the IPv4 address shortage was survivable.
Exam note (October 2017-এ এসেছে): BUET NAT আর PAT-এর পার্থক্য জানতে চেয়েছিল। এক লাইনে উত্তর: NAT একটা private IP-কে একটা public IP-তে map করে (শুধু address); PAT port number-ও translate করে অনেক private IP-কে একটা public IP-তে map করে। Bonus point: PAT-এর কারণেই IPv4 address-এর অভাব সামলানো গেছে।
Exam tip: Routing questions to expect: pick the route by longest prefix match, name the algorithm behind RIP (Bellman–Ford) and OSPF (Dijkstra), and RIP's max hop count (15).
Exam tip: Routing থেকে যা আসতে পারে: longest prefix match দিয়ে route বাছা, RIP-এর algorithm (Bellman–Ford) আর OSPF-এর algorithm (Dijkstra), আর RIP-এর max hop count (15)।

5. TCP and UDP5. TCP এবং UDP

The Transport layer gives us two main protocols. TCP is careful: it connects first, numbers every byte, and re-sends lost data. UDP is fast and simple: it just throws packets and hopes for the best. Both use port numbers to find the right program on a machine.

Transport layer আমাদের দুইটা প্রধান protocol দেয়। TCP সাবধানী: আগে connect করে, প্রতিটা byte-এ নম্বর দেয়, হারানো data আবার পাঠায়। UDP দ্রুত আর সহজ: শুধু packet ছুঁড়ে দেয়, বাকিটা ভাগ্য। দুটোই machine-এর ভিতরে ঠিক program খুঁজে পেতে port number ব্যবহার করে।

Header fields that matterযে header field গুলো জরুরি

  • TCP header (20+ bytes): source port, destination port, sequence number, acknowledgment number, flags (SYN, ACK, FIN, RST, PSH, URG), window size (flow control), checksum.
  • UDP header (only 8 bytes): source port, destination port, length, checksum. That is all — no seq, no ack, no flags.
  • TCP header (20+ bytes): source port, destination port, sequence number, acknowledgment number, flags (SYN, ACK, FIN, RST, PSH, URG), window size (flow control), checksum।
  • UDP header (মাত্র 8 bytes): source port, destination port, length, checksum। এটুকুই — seq নেই, ack নেই, flag নেই।

3-way handshake: opening a connection3-way handshake: connection খোলা

TCP starts every connection with three messages:

  1. SYN: client → server. "Let's talk. My starting sequence number is x."
  2. SYN + ACK: server → client. "OK. My starting number is y. I acknowledge yours: ack = x + 1."
  3. ACK: client → server. "Got it. ack = y + 1." Connection is now open.

TCP প্রতিটা connection শুরু করে তিনটা message দিয়ে:

  1. SYN: client → server। "চলো কথা বলি। আমার starting sequence number হলো x।"
  2. SYN + ACK: server → client। "ঠিক আছে। আমার starting number হলো y। তোমারটা পেয়েছি: ack = x + 1।"
  3. ACK: client → server। "পেয়েছি। ack = y + 1।" Connection এখন খোলা।
TCP three-way handshake: SYN, SYN-ACK, ACK between client and server
The TCP 3-way handshake: SYN → SYN-ACK → ACK. TCP 3-way handshake: SYN → SYN-ACK → ACK।
Example (with numbers): Client picks x = 1000, server picks y = 5000.
  1. Client → Server: SYN, seq = 1000
  2. Server → Client: SYN + ACK, seq = 5000, ack = 1001
  3. Client → Server: ACK, seq = 1001, ack = 5001
The SYN and FIN flags each "use up" one sequence number, which is why the ack is x + 1, not x.
Example (সংখ্যা সহ): Client নেয় x = 1000, server নেয় y = 5000।
  1. Client → Server: SYN, seq = 1000
  2. Server → Client: SYN + ACK, seq = 5000, ack = 1001
  3. Client → Server: ACK, seq = 1001, ack = 5001
SYN আর FIN flag প্রতিটা একটা করে sequence number "খরচ" করে, তাই ack হয় x + 1, শুধু x না।

Closing a connection (teardown)Connection বন্ধ করা (teardown)

Closing normally takes 4 messages, because each side closes its own direction:

  1. A → B: FIN ("I am done sending.")
  2. B → A: ACK
  3. B → A: FIN ("I am done too.")
  4. A → B: ACK, then A waits in TIME_WAIT for a while before fully closing, in case the last ACK gets lost.

স্বাভাবিকভাবে বন্ধ করতে লাগে 4টা message, কারণ প্রতিটা পক্ষ নিজের দিকটা আলাদা করে বন্ধ করে:

  1. A → B: FIN ("আমার পাঠানো শেষ।")
  2. B → A: ACK
  3. B → A: FIN ("আমারও শেষ।")
  4. A → B: ACK, তারপর A কিছুক্ষণ TIME_WAIT-এ অপেক্ষা করে, যদি শেষ ACK-টা হারিয়ে যায় সেই ভয়ে।

Reliability: sequence and acknowledgment numbersReliability: sequence এবং acknowledgment number

TCP numbers every byte (not every packet). The receiver replies with an ack number = "the next byte I expect." If an ack does not come in time, the sender re-sends. This gives reliable, in-order delivery.

TCP প্রতিটা byte-এ নম্বর দেয় (প্রতিটা packet-এ না)। Receiver ack number দিয়ে উত্তর দেয় = "পরের যে byte-টা আমি আশা করছি।" সময়মতো ack না এলে sender আবার পাঠায়। এতেই reliable, in-order delivery পাওয়া যায়।

Example: A sends 100 bytes starting at seq 1001 (bytes 1001–1100). B replies ack = 1101 ("send me byte 1101 next"). A then sends bytes 1101–1200; B replies ack = 1201. If the segment 1101–1200 is lost, B keeps saying ack = 1101, so A re-sends from 1101.
Example: A seq 1001 থেকে 100 byte পাঠায় (byte 1001–1100)। B উত্তর দেয় ack = 1101 ("এরপর byte 1101 পাঠাও")। তারপর A পাঠায় byte 1101–1200; B বলে ack = 1201। 1101–1200 segment-টা হারিয়ে গেলে B বারবার ack = 1101 বলতে থাকে, তাই A আবার 1101 থেকে পাঠায়।

Flow control and congestion controlFlow control এবং congestion control

  • Flow control (sliding window): protects the receiver. The receiver advertises a window size = how many bytes it can accept right now. The sender may send that much without waiting for an ack. Window 0 means "stop, I am full."
  • Congestion control: protects the network. TCP keeps a congestion window (cwnd). In slow start, cwnd starts small (about 1 MSS) and doubles every RTT (1 → 2 → 4 → 8...) until it reaches a threshold (ssthresh). After that, congestion avoidance grows it by 1 MSS per RTT (additive increase). On packet loss, TCP cuts the window down sharply (multiplicative decrease) — together called AIMD.
  • Flow control (sliding window): receiver-কে বাঁচায়। Receiver একটা window size জানায় = এই মুহূর্তে সে কত byte নিতে পারবে। Sender ack-এর অপেক্ষা না করেই ওইটুকু পাঠাতে পারে। Window 0 মানে "থামো, আমি ভর্তি।"
  • Congestion control: network-কে বাঁচায়। TCP একটা congestion window (cwnd) রাখে। Slow start-এ cwnd ছোট থেকে শুরু করে (প্রায় 1 MSS) আর প্রতি RTT-তে double হয় (1 → 2 → 4 → 8...) যতক্ষণ না threshold (ssthresh)-এ পৌঁছায়। তারপর congestion avoidance-এ প্রতি RTT-তে 1 MSS করে বাড়ে (additive increase)। Packet হারালে TCP window হঠাৎ অনেক কমিয়ে দেয় (multiplicative decrease) — দুটো মিলে AIMD

TCP vs UDPTCP vs UDP

TCPUDP
ConnectionConnection Connection-oriented (handshake first)Connection-oriented (আগে handshake) ConnectionlessConnectionless
ReliabilityReliability Reliable — ack, retransmit, in-orderReliable — ack, retransmit, in-order Best effort — may lose or reorderBest effort — হারাতে বা এলোমেলো হতে পারে
Speed / overheadSpeed / overhead Slower, 20+ byte headerধীর, 20+ byte header Fast, 8 byte headerদ্রুত, 8 byte header
Flow / congestion controlFlow / congestion control Yesআছে Noনেই
Data unitData unit Segment Datagram
Used byকারা ব্যবহার করে HTTP/HTTPS, FTP, SMTP, SSH, Telnet, POP3, IMAP DNS, DHCP, VoIP, video streaming, online gamesvideo streaming, online game, TFTP, SNMP
Exam tip: Handshake numbers are a classic question: reply to SYN seq = x is SYN+ACK seq = y, ack = x+1; final ACK has ack = y+1. Also remember: connection open = 3 messages, close = 4 messages, UDP header = 8 bytes, TCP header = 20 bytes (minimum). DNS uses UDP (port 53) for normal queries — a favorite trick option.
Exam tip: Handshake-এর সংখ্যা নিয়ে প্রশ্ন খুব common: SYN seq = x-এর উত্তর হলো SYN+ACK seq = y, ack = x+1; শেষ ACK-এ থাকে ack = y+1। আরও মনে রাখুন: connection খোলা = 3টা message, বন্ধ = 4টা message, UDP header = 8 bytes, TCP header = 20 bytes (minimum)। DNS সাধারণ query-তে UDP (port 53) ব্যবহার করে — এটা প্রায়ই trick option হিসেবে আসে।

Delay Calculations (Real Exam Topic!)Delay Calculation (Real Exam Topic!)

How long does a packet take to travel? Four delays add up on every link. The two that exams love are transmission delay and propagation delay — students mix them up all the time.

  • Transmission delay: time to push all the bits of the packet onto the wire. Depends on packet size \( L \) and link rate (bandwidth) \( R \).
  • Propagation delay: time for one bit to travel the length of the wire. Depends on distance \( d \) and signal speed \( s \) in the medium (about \( 2 \times 10^{8} \) m/s in copper or fiber).
  • Queuing delay: time waiting in the router's buffer for its turn.
  • Processing delay: time the router spends checking headers and choosing the output link.

একটা packet পৌঁছাতে কতক্ষণ লাগে? প্রতিটা link-এ চার রকম delay যোগ হয়। পরীক্ষার সবচেয়ে প্রিয় দুইটা হলো transmission delay আর propagation delay — students এই দুইটা সবসময় গুলিয়ে ফেলে।

  • Transmission delay: packet-এর সব bit তারে ঠেলে দিতে যে সময় লাগে। এটা নির্ভর করে packet size \( L \) আর link rate (bandwidth) \( R \)-এর উপর।
  • Propagation delay: একটা bit-এর তারের পুরো দৈর্ঘ্য পাড়ি দিতে যে সময় লাগে। এটা নির্ভর করে distance \( d \) আর medium-এ signal speed \( s \)-এর উপর (copper বা fiber-এ প্রায় \( 2 \times 10^{8} \) m/s)।
  • Queuing delay: router-এর buffer-এ নিজের পালার জন্য অপেক্ষার সময়।
  • Processing delay: router header check করে output link বাছতে যে সময় নেয়।
\[ d_{trans} = \frac{L}{R} \qquad d_{prop} = \frac{d}{s} \] \[ d_{total} = d_{trans} + d_{prop} + d_{queue} + d_{proc} \]
Example 1 (the standard exam setup): a 1000-byte packet is sent over a 1 Mbps link that is 100 km long. Signal speed is \( 2 \times 10^{8} \) m/s. Ignore queuing and processing.
  1. Transmission: \( L = 1000 \times 8 = 8000 \) bits, \( R = 10^{6} \) bps. \( d_{trans} = 8000 / 10^{6} = 8 \) ms.
  2. Propagation: \( d = 100 \) km \( = 10^{5} \) m. \( d_{prop} = 10^{5} / (2 \times 10^{8}) = 0.5 \) ms.
  3. Total: \( 8 + 0.5 = 8.5 \) ms.
Watch the unit trap: bytes must become bits (×8), and km must become metres.
Example 1 (পরীক্ষার standard setup): 1000-byte-এর একটা packet 1 Mbps link দিয়ে পাঠানো হলো, link-টা 100 km লম্বা। Signal speed \( 2 \times 10^{8} \) m/s। Queuing আর processing বাদ দিন।
  1. Transmission: \( L = 1000 \times 8 = 8000 \) bits, \( R = 10^{6} \) bps। \( d_{trans} = 8000 / 10^{6} = 8 \) ms।
  2. Propagation: \( d = 100 \) km \( = 10^{5} \) m। \( d_{prop} = 10^{5} / (2 \times 10^{8}) = 0.5 \) ms।
  3. Total: \( 8 + 0.5 = 8.5 \) ms।
Unit-এর ফাঁদ খেয়াল করুন: byte-কে bit বানাতে হবে (×8), আর km-কে metre।
Example 2 (when does propagation dominate?): a geostationary satellite sits about 36,000 km up. \( d_{prop} = 3.6 \times 10^{7} / (3 \times 10^{8}) \approx 120 \) ms one way — no matter how small the packet or how fast the link. On a 100 m LAN the propagation is only \( 100 / (2 \times 10^{8}) = 0.0005 \) ms, so there the transmission delay is what matters. Long links → propagation wins; short fat links → transmission wins.
Example 2 (propagation কখন বড় হয়?): একটা geostationary satellite প্রায় 36,000 km উপরে থাকে। \( d_{prop} = 3.6 \times 10^{7} / (3 \times 10^{8}) \approx 120 \) ms এক দিকে — packet যত ছোটই হোক, link যত দ্রুতই হোক। অন্যদিকে 100 m-এর একটা LAN-এ propagation মাত্র \( 100 / (2 \times 10^{8}) = 0.0005 \) ms, তাই সেখানে transmission delay-টাই আসল। লম্বা link → propagation জেতে; ছোট কিন্তু দ্রুত link → transmission জেতে।
The classic insight (memorize this line): transmission delay depends on packet size and bandwidth; propagation delay depends only on distance and the medium. Doubling the bandwidth halves transmission delay but changes propagation delay by exactly zero.
Classic insight (এই লাইনটা মুখস্থ রাখুন): transmission delay নির্ভর করে packet size আর bandwidth-এর উপর; propagation delay নির্ভর করে শুধু distance আর medium-এর উপর। Bandwidth দ্বিগুণ করলে transmission delay অর্ধেক হয়, কিন্তু propagation delay একটুও বদলায় না।

6. Application Layer Protocols6. Application Layer Protocol

HTTP: the web's protocolHTTP: web-এর protocol

HTTP is a simple text protocol. The client (browser) sends a request; the server sends a response. HTTP is stateless — each request stands alone (cookies are used to remember users). HTTPS is HTTP over TLS encryption.

HTTP একটা সহজ text protocol। Client (browser) একটা request পাঠায়; server একটা response পাঠায়। HTTP stateless — প্রতিটা request আলাদা (user মনে রাখতে cookie ব্যবহার হয়)। HTTPS হলো TLS encryption-এর উপর HTTP।

Example: a real request and response pair.
Example: সত্যিকারের একজোড়া request আর response।
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html

HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1256

<html> ... page content ... </html>

Line 1 of the request = method + path + version. Line 1 of the response = version + status code + phrase.

Request-এর প্রথম line = method + path + version। Response-এর প্রথম line = version + status code + phrase।

HTTP methodHTTP method Meaningঅর্থ Status codeStatus code Meaningঅর্থ
GETRead a resourceResource পড়া200 OKSuccessসফল
POSTSend data / createData পাঠানো / create301Moved permanently (redirect)স্থায়ীভাবে সরানো (redirect)
PUTReplace / updateReplace / update403Forbidden
DELETERemoveমুছে ফেলা404Not Found
HEADHeaders only, no bodyশুধু header, body না500Internal Server Error

Code groups: 2xx success, 3xx redirect, 4xx client error, 5xx server error.

Code-এর group: 2xx success, 3xx redirect, 4xx client error, 5xx server error।

DNS: name to IP, step by stepDNS: নাম থেকে IP, ধাপে ধাপে

DNS (Domain Name System) turns names like www.example.com into IP addresses. It is a big distributed database arranged as a tree: root → TLD (.com, .org, .bd) → authoritative servers.

DNS (Domain Name System) www.example.com-এর মতো নামকে IP address-এ বদলায়। এটা একটা বিশাল distributed database, গাছের মতো সাজানো: root → TLD (.com, .org, .bd) → authoritative server।

Example (resolving www.example.com):
  1. Browser checks its own cache, then the OS cache. Not found.
  2. The PC asks its configured recursive resolver (often the ISP's, or 8.8.8.8).
  3. The resolver asks a root server: "www.example.com?" Root replies: "Ask the .com TLD servers, here they are."
  4. The resolver asks a .com TLD server. It replies: "Ask example.com's authoritative server, here it is."
  5. The resolver asks the authoritative server, which answers: "www.example.com is 93.184.216.34" (an A record).
  6. The resolver caches the answer (for the TTL time) and returns it to the PC. The browser now connects to that IP.
Steps 3–5 are iterative queries by the resolver; the PC-to-resolver query is recursive.
Example (www.example.com resolve করা):
  1. Browser নিজের cache দেখে, তারপর OS-এর cache। পাওয়া গেল না।
  2. PC তার set করা recursive resolver-কে জিজ্ঞেস করে (সাধারণত ISP-র, বা 8.8.8.8)।
  3. Resolver একটা root server-কে জিজ্ঞেস করে: "www.example.com?" Root বলে: ".com TLD server-দের জিজ্ঞেস করো, এই যে ঠিকানা।"
  4. Resolver একটা .com TLD server-কে জিজ্ঞেস করে। সে বলে: "example.com-এর authoritative server-কে জিজ্ঞেস করো, এই যে।"
  5. Resolver authoritative server-কে জিজ্ঞেস করে, আর সে উত্তর দেয়: "www.example.com হলো 93.184.216.34" (একটা A record)।
  6. Resolver উত্তরটা cache করে রাখে (TTL সময় পর্যন্ত) আর PC-কে ফেরত দেয়। Browser এখন ওই IP-তে connect করে।
ধাপ 3–5 হলো resolver-এর iterative query; PC থেকে resolver-এর query-টা recursive

Common record types: A (name → IPv4), AAAA (name → IPv6), CNAME (alias), MX (mail server), NS (name server).

Common record type: A (নাম → IPv4), AAAA (নাম → IPv6), CNAME (alias), MX (mail server), NS (name server)।

DHCP: getting an IP automatically (DORA)DHCP: নিজে নিজে IP পাওয়া (DORA)

DHCP gives a device its IP address, subnet mask, gateway, and DNS server — automatically. The 4 steps spell DORA:

  1. Discover — client broadcasts: "Any DHCP server here?"
  2. Offer — server replies: "You can have 192.168.1.50."
  3. Request — client broadcasts: "I accept 192.168.1.50."
  4. Ack — server confirms and sets a lease time.

DHCP uses UDP: server port 67, client port 68.

DHCP একটা device-কে তার IP address, subnet mask, gateway আর DNS server — সব নিজে নিজে দিয়ে দেয়। 4টা ধাপ মিলে DORA:

  1. Discover — client broadcast করে: "এখানে কোনো DHCP server আছে?"
  2. Offer — server উত্তর দেয়: "তুমি 192.168.1.50 নিতে পারো।"
  3. Request — client broadcast করে: "আমি 192.168.1.50 নিলাম।"
  4. Ack — server confirm করে আর একটা lease time ঠিক করে দেয়।

DHCP UDP ব্যবহার করে: server port 67, client port 68।

Email: SMTP, POP3, IMAPEmail: SMTP, POP3, IMAP

  • SMTP (port 25): sends mail — from your app to your mail server, and between mail servers. "SMTP = Send Mail To People."
  • POP3 (port 110): downloads mail to one device and usually deletes it from the server. Simple, offline-friendly.
  • IMAP (port 143): syncs mail — messages stay on the server, and all your devices see the same folders and read/unread state. This is what modern apps use.
  • SMTP (port 25): mail পাঠায় — আপনার app থেকে mail server-এ, আর এক mail server থেকে আরেকটায়। "SMTP = Send Mail To People।"
  • POP3 (port 110): mail একটা device-এ download করে আর সাধারণত server থেকে মুছে দেয়। সহজ, offline-এ কাজ চলে।
  • IMAP (port 143): mail sync করে — message server-এই থাকে, সব device একই folder আর read/unread অবস্থা দেখে। আধুনিক app-গুলো এটাই ব্যবহার করে।

FTPFTP

FTP (File Transfer Protocol) moves files. It is unusual: it uses two TCP connections — port 21 for control (commands) and port 20 for data (active mode). It sends passwords in plain text, so today people use SFTP or FTPS instead.

FTP (File Transfer Protocol) file আনা-নেওয়া করে। এটা একটু অন্যরকম: দুইটা TCP connection ব্যবহার করে — control (command)-এর জন্য port 21 আর data-র জন্য port 20 (active mode)। Password plain text-এ পাঠায়, তাই এখন মানুষ SFTP বা FTPS ব্যবহার করে।

Well-known port numbers (memorize!)Well-known port number (মুখস্থ করুন!)

Port Protocol TCP/UDP Used forকীসের জন্য
20, 21FTPTCPFile transfer (20 data, 21 control)File transfer (20 data, 21 control)
22SSHTCPSecure remote loginSecure remote login
23TelnetTCPRemote login (insecure)Remote login (insecure)
25SMTPTCPSending emailEmail পাঠানো
53DNSUDP (TCP for big transfers)UDP (বড় transfer-এ TCP)Name resolutionName resolution
67, 68DHCPUDPAuto IP assignment (67 server, 68 client)Auto IP দেওয়া (67 server, 68 client)
80HTTPTCPWeb
110POP3TCPEmail downloadEmail download
143IMAPTCPEmail syncEmail sync
443HTTPSTCPSecure webSecure web
3306MySQLTCPDatabase
Exam tip: Port questions are almost guaranteed. Quick memory line: 21 FTP, 22 SSH, 23 Telnet, 25 SMTP, 53 DNS, 80 HTTP, 110 POP3, 143 IMAP, 443 HTTPS. Ports 0–1023 are called well-known ports. Also remember DORA for DHCP and that DNS + DHCP run on UDP.
Exam tip: Port নিয়ে প্রশ্ন প্রায় নিশ্চিত। দ্রুত মনে রাখার লাইন: 21 FTP, 22 SSH, 23 Telnet, 25 SMTP, 53 DNS, 80 HTTP, 110 POP3, 143 IMAP, 443 HTTPS। Port 0–1023-কে বলে well-known port। আরও মনে রাখুন: DHCP মানে DORA, আর DNS + DHCP চলে UDP-তে।

Practice Questions (Admission Style)Practice Questions (Admission Style)

Q1. Which OSI layer is responsible for routing packets between networks?
  • (a) Data Link
  • (b) Transport
  • (c) Network
  • (d) Session
Q1. এক network থেকে আরেক network-এ packet routing-এর দায়িত্ব OSI-এর কোন layer-এর?
  • (a) Data Link
  • (b) Transport
  • (c) Network
  • (d) Session
Show Answerউত্তর দেখুন
Answer: (c) — The Network layer (layer 3) handles logical (IP) addressing and routing. Routers work at this layer. Data Link only moves frames inside one LAN; Transport handles end-to-end delivery with ports.
Answer: (c) — Network layer (layer 3) logical (IP) addressing আর routing সামলায়। Router এই layer-এ কাজ করে। Data Link শুধু একটা LAN-এর ভিতরে frame পাঠায়; Transport port দিয়ে end-to-end delivery করে।
Q2. The data unit (PDU) at the Transport layer for TCP is called a:
  • (a) Frame
  • (b) Packet
  • (c) Segment
  • (d) Bit
Q2. TCP-র জন্য Transport layer-এর data unit (PDU)-এর নাম কী?
  • (a) Frame
  • (b) Packet
  • (c) Segment
  • (d) Bit
Show Answerউত্তর দেখুন
Answer: (c) — The full order is: Application = Data, Transport = Segment (TCP) / Datagram (UDP), Network = Packet, Data Link = Frame, Physical = Bit.
Answer: (c) — পুরো ক্রমটা হলো: Application = Data, Transport = Segment (TCP) / Datagram (UDP), Network = Packet, Data Link = Frame, Physical = Bit।
Q3. A MAC address is how many bits long?
  • (a) 32 bits
  • (b) 48 bits
  • (c) 64 bits
  • (d) 128 bits
Q3. একটা MAC address কত bit লম্বা?
  • (a) 32 bits
  • (b) 48 bits
  • (c) 64 bits
  • (d) 128 bits
Show Answerউত্তর দেখুন
Answer: (b) — A MAC address is 48 bits (6 bytes), written as 12 hex digits like 00:1A:2B:3C:4D:5E. Compare: IPv4 = 32 bits, IPv6 = 128 bits.
Answer: (b) — MAC address 48 bit (6 byte), 12টা hex digit দিয়ে লেখা হয়, যেমন 00:1A:2B:3C:4D:5E। তুলনা: IPv4 = 32 bit, IPv6 = 128 bit।
Q4. Which protocol finds the MAC address for a known IP address?
  • (a) DNS
  • (b) DHCP
  • (c) ICMP
  • (d) ARP
Q4. জানা IP address থেকে MAC address খুঁজে বের করে কোন protocol?
  • (a) DNS
  • (b) DHCP
  • (c) ICMP
  • (d) ARP
Show Answerউত্তর দেখুন
Answer: (d) — ARP maps IP → MAC using a broadcast request and a unicast reply. DNS maps name → IP, DHCP assigns IPs, ICMP reports errors (used by ping).
Answer: (d) — ARP broadcast request আর unicast reply দিয়ে IP → MAC map করে। DNS করে নাম → IP, DHCP IP দেয়, ICMP error জানায় (ping এটা ব্যবহার করে)।
Q5. The default subnet mask of a Class C network is:
  • (a) 255.0.0.0
  • (b) 255.255.0.0
  • (c) 255.255.255.0
  • (d) 255.255.255.255
Q5. Class C network-এর default subnet mask কোনটা?
  • (a) 255.0.0.0
  • (b) 255.255.0.0
  • (c) 255.255.255.0
  • (d) 255.255.255.255
Show Answerউত্তর দেখুন
Answer: (c) — Class C (first octet 192–223) uses /24 = 255.255.255.0 by default. Class A uses /8, Class B uses /16.
Answer: (c) — Class C (প্রথম octet 192–223)-এর default হলো /24 = 255.255.255.0। Class A ব্যবহার করে /8, Class B ব্যবহার করে /16।
Q6. (Written) How many usable host addresses are there in a /26 subnet? Show the calculation.
Q6. (লিখিত) একটা /26 subnet-এ কয়টা usable host address আছে? হিসাব দেখান।
Show Answerউত্তর দেখুন
Answer: 62.
  1. Host bits: \( h = 32 - 26 = 6 \).
  2. Total addresses: \( 2^{6} = 64 \).
  3. Subtract 2 (one network address, one broadcast address): \( 64 - 2 = 62 \) usable hosts.
Answer: 62।
  1. Host bit: \( h = 32 - 26 = 6 \)।
  2. মোট address: \( 2^{6} = 64 \)।
  3. 2টা বাদ দিন (একটা network address, একটা broadcast address): \( 64 - 2 = 62 \)টা usable host।
Q7. Which of these is a private IP address?
  • (a) 172.32.1.1
  • (b) 11.0.0.5
  • (c) 172.16.5.4
  • (d) 192.169.1.1
Q7. নিচের কোনটা private IP address?
  • (a) 172.32.1.1
  • (b) 11.0.0.5
  • (c) 172.16.5.4
  • (d) 192.169.1.1
Show Answerউত্তর দেখুন
Answer: (c) — Private ranges are 10.0.0.0/8, 172.16.0.0 – 172.31.255.255, and 192.168.0.0/16. 172.16.5.4 is inside the second range. The traps: 172.32 is just outside (range ends at 172.31), 11.x is outside 10/8, and 192.169 is not 192.168.
Answer: (c) — Private range হলো 10.0.0.0/8, 172.16.0.0 – 172.31.255.255, আর 192.168.0.0/16। 172.16.5.4 দ্বিতীয় range-এর ভিতরে। ফাঁদগুলো: 172.32 ঠিক বাইরে (range শেষ 172.31-এ), 11.x হলো 10/8-এর বাইরে, আর 192.169 মানে 192.168 না।
Q8. (Written) For the address 192.168.1.130/26, find the network address, broadcast address, and usable host range. Show the binary work.
Q8. (লিখিত) 192.168.1.130/26 address-টার network address, broadcast address আর usable host range বের করুন। Binary হিসাব দেখান।
Show Answerউত্তর দেখুন
Answer: network 192.168.1.128, broadcast 192.168.1.191, hosts .129 – .190.
  1. /26 → mask 255.255.255.192, host bits = 6, block size = 64. Subnets: .0, .64, .128, .192.
  2. Binary of the last octet: 130 = 10 000010. Mask 192 = 11 000000.
  3. AND them: 10 000000 = 128 → network = 192.168.1.128.
  4. Broadcast: host bits all 1 → 10 111111 = 191 → 192.168.1.191.
  5. Usable range: 129 to 190, which is \( 2^{6}-2 = 62 \) hosts.
Answer: network 192.168.1.128, broadcast 192.168.1.191, host .129 – .190
  1. /26 → mask 255.255.255.192, host bit = 6, block size = 64। Subnet: .0, .64, .128, .192।
  2. শেষ octet-এর binary: 130 = 10 000010। Mask 192 = 11 000000
  3. AND করুন: 10 000000 = 128 → network = 192.168.1.128
  4. Broadcast: সব host bit 1 → 10 111111 = 191 → 192.168.1.191
  5. Usable range: 129 থেকে 190, মানে \( 2^{6}-2 = 62 \)টা host।
Q9. The correct order of the TCP 3-way handshake is:
  • (a) ACK → SYN → SYN+ACK
  • (b) SYN → ACK → SYN+ACK
  • (c) SYN → SYN+ACK → ACK
  • (d) SYN+ACK → SYN → ACK
Q9. TCP 3-way handshake-এর সঠিক ক্রম কোনটা?
  • (a) ACK → SYN → SYN+ACK
  • (b) SYN → ACK → SYN+ACK
  • (c) SYN → SYN+ACK → ACK
  • (d) SYN+ACK → SYN → ACK
Show Answerউত্তর দেখুন
Answer: (c) — Client sends SYN, server answers SYN+ACK, client finishes with ACK. Three messages, then the connection is open in both directions.
Answer: (c) — Client পাঠায় SYN, server উত্তর দেয় SYN+ACK, client শেষ করে ACK দিয়ে। তিনটা message, তারপর connection দুই দিকেই খোলা।
Q10. (Written) A client starts a TCP connection with initial sequence number 5000. The server's initial sequence number is 9000. Write all three handshake messages with their seq and ack values.
Q10. (লিখিত) একটা client initial sequence number 5000 দিয়ে TCP connection শুরু করে। Server-এর initial sequence number 9000। তিনটা handshake message-ই seq আর ack value সহ লিখুন।
Show Answerউত্তর দেখুন
Answer:
  1. Client → Server: SYN, seq = 5000
  2. Server → Client: SYN + ACK, seq = 9000, ack = 5001 (ack = client's seq + 1, because SYN consumes one number)
  3. Client → Server: ACK, seq = 5001, ack = 9001 (ack = server's seq + 1)
Answer:
  1. Client → Server: SYN, seq = 5000
  2. Server → Client: SYN + ACK, seq = 9000, ack = 5001 (ack = client-এর seq + 1, কারণ SYN একটা নম্বর খরচ করে)
  3. Client → Server: ACK, seq = 5001, ack = 9001 (ack = server-এর seq + 1)
Q11. Which application protocol normally runs over UDP?
  • (a) HTTP
  • (b) FTP
  • (c) DNS
  • (d) SMTP
Q11. কোন application protocol সাধারণত UDP-র উপর চলে?
  • (a) HTTP
  • (b) FTP
  • (c) DNS
  • (d) SMTP
Show Answerউত্তর দেখুন
Answer: (c) — DNS queries are small and need speed, so DNS uses UDP port 53 (TCP only for large zone transfers). HTTP, FTP, and SMTP all need reliable delivery, so they use TCP.
Answer: (c) — DNS query ছোট আর দ্রুত হওয়া দরকার, তাই DNS ব্যবহার করে UDP port 53 (বড় zone transfer-এ শুধু TCP)। HTTP, FTP, SMTP-র reliable delivery দরকার, তাই এরা TCP ব্যবহার করে।
Q12. (Written) Divide 192.168.4.0/24 into 8 equal subnets. Give the new prefix, the usable hosts per subnet, and list the first three subnets with their broadcast addresses. Show the binary reasoning.
Q12. (লিখিত) 192.168.4.0/24-কে 8টা সমান subnet-এ ভাগ করুন। নতুন prefix, প্রতি subnet-এ usable host সংখ্যা দিন, আর প্রথম তিনটা subnet-এর broadcast address সহ list করুন। Binary যুক্তি দেখান।
Show Answerউত্তর দেখুন
Answer:
  1. Need 8 subnets: \( 2^{s} \ge 8 \Rightarrow s = 3 \) borrowed bits. New prefix = 24 + 3 = /27 (mask 255.255.255.224).
  2. Host bits: \( 32 - 27 = 5 \) → usable hosts = \( 2^{5} - 2 = 30 \) per subnet.
  3. Block size = \( 2^{5} = 32 \). The borrowed 3 bits count 000, 001, 010, ... in the last octet:
    000 00000 = .0     001 00000 = .32     010 00000 = .64
  4. Subnet 1: 192.168.4.0/27, broadcast .31, hosts .1–.30
    Subnet 2: 192.168.4.32/27, broadcast .63, hosts .33–.62
    Subnet 3: 192.168.4.64/27, broadcast .95, hosts .65–.94
  5. (The rest continue every 32: .96, .128, .160, .192, .224.)
Answer:
  1. 8টা subnet দরকার: \( 2^{s} \ge 8 \Rightarrow s = 3 \)টা bit ধার। নতুন prefix = 24 + 3 = /27 (mask 255.255.255.224)।
  2. Host bit: \( 32 - 27 = 5 \) → প্রতি subnet-এ usable host = \( 2^{5} - 2 = 30 \)।
  3. Block size = \( 2^{5} = 32 \)। ধার নেওয়া 3 bit শেষ octet-এ 000, 001, 010, ... এভাবে গোনে:
    000 00000 = .0     001 00000 = .32     010 00000 = .64
  4. Subnet 1: 192.168.4.0/27, broadcast .31, host .1–.30
    Subnet 2: 192.168.4.32/27, broadcast .63, host .33–.62
    Subnet 3: 192.168.4.64/27, broadcast .95, host .65–.94
  5. (বাকিগুলো প্রতি 32 পর পর: .96, .128, .160, .192, .224।)
Q13. Port 443 is used by:
  • (a) HTTP
  • (b) HTTPS
  • (c) SSH
  • (d) DNS
Q13. Port 443 কে ব্যবহার করে?
  • (a) HTTP
  • (b) HTTPS
  • (c) SSH
  • (d) DNS
Show Answerউত্তর দেখুন
Answer: (b) — HTTPS (HTTP over TLS) uses TCP port 443. HTTP = 80, SSH = 22, DNS = 53.
Answer: (b) — HTTPS (TLS-এর উপর HTTP) ব্যবহার করে TCP port 443। HTTP = 80, SSH = 22, DNS = 53।
Q14. (Written) A router has these routes:
  • R1: 10.0.0.0/8 → interface A
  • R2: 10.1.0.0/16 → interface B
  • R3: 10.1.5.0/24 → interface C
  • R4: 0.0.0.0/0 → interface D
Which interface does a packet for 10.1.5.20 use? Which one does a packet for 10.2.7.9 use? Explain.
Q14. (লিখিত) একটা router-এ এই route গুলো আছে:
  • R1: 10.0.0.0/8 → interface A
  • R2: 10.1.0.0/16 → interface B
  • R3: 10.1.5.0/24 → interface C
  • R4: 0.0.0.0/0 → interface D
10.1.5.20-এর packet কোন interface দিয়ে যাবে? আর 10.2.7.9-এর packet? ব্যাখ্যা করুন।
Show Answerউত্তর দেখুন
Answer: interface C, then interface A.
  1. For 10.1.5.20: R1 (/8), R2 (/16), R3 (/24), and R4 (/0) all match. The router picks the longest prefix → /24 → interface C.
  2. For 10.2.7.9: R2 needs 10.1.x.x (no), R3 needs 10.1.5.x (no). Matches are R1 (/8) and R4 (/0). Longest = /8 → interface A.
Answer: interface C, তারপর interface A।
  1. 10.1.5.20-এর জন্য: R1 (/8), R2 (/16), R3 (/24), R4 (/0) সবগুলোই মেলে। Router সবচেয়ে লম্বা prefix নেয় → /24 → interface C
  2. 10.2.7.9-এর জন্য: R2 চায় 10.1.x.x (না), R3 চায় 10.1.5.x (না)। মেলে R1 (/8) আর R4 (/0)। লম্বাটা = /8 → interface A
Q15. (Written, hard) A company has the block 192.168.0.0/24. It needs 4 departments, each with at least 50 hosts. Design the subnets: give the prefix, all 4 network and broadcast addresses, and show why a /27 would NOT work.
Q15. (লিখিত, কঠিন) একটা company-র কাছে 192.168.0.0/24 block আছে। তাদের 4টা department দরকার, প্রতিটায় কমপক্ষে 50টা host। Subnet design করুন: prefix দিন, 4টা network আর broadcast address দিন, আর দেখান কেন /27 কাজ করবে না।
Show Answerউত্তর দেখুন
Answer: use /26.
  1. Host requirement: 50 hosts + network + broadcast = 52 addresses needed. Find \( h \) with \( 2^{h} - 2 \ge 50 \). \( h = 5 \) gives 30 (too small). \( h = 6 \) gives 62 (enough). So 6 host bits → prefix = 32 − 6 = /26.
  2. Subnet count check: /24 → /26 borrows 2 bits → \( 2^{2} = 4 \) subnets. Exactly what we need.
  3. Why /27 fails: /27 leaves 5 host bits → \( 2^{5} - 2 = 30 \) usable hosts < 50. Not enough, even though it gives 8 subnets.
  4. The 4 subnets (block size 64):
    DeptNetworkBroadcastHosts
    1192.168.0.0/26192.168.0.63.1–.62
    2192.168.0.64/26192.168.0.127.65–.126
    3192.168.0.128/26192.168.0.191.129–.190
    4192.168.0.192/26192.168.0.255.193–.254
  5. Binary of the borrowed bits: 00, 01, 10, 11 → last octet starts 0, 64, 128, 192.
Answer: /26 ব্যবহার করুন।
  1. Host-এর চাহিদা: 50 host + network + broadcast = 52টা address লাগবে। এমন \( h \) খুঁজুন যেন \( 2^{h} - 2 \ge 50 \)। \( h = 5 \) দেয় 30 (কম)। \( h = 6 \) দেয় 62 (যথেষ্ট)। তাই 6টা host bit → prefix = 32 − 6 = /26
  2. Subnet সংখ্যা check: /24 → /26 মানে 2 bit ধার → \( 2^{2} = 4 \)টা subnet। ঠিক যা দরকার।
  3. /27 কেন fail করে: /27-এ host bit থাকে 5টা → \( 2^{5} - 2 = 30 \)টা usable host < 50। যথেষ্ট না, যদিও subnet পাওয়া যায় 8টা।
  4. 4টা subnet (block size 64):
    DeptNetworkBroadcastHost
    1192.168.0.0/26192.168.0.63.1–.62
    2192.168.0.64/26192.168.0.127.65–.126
    3192.168.0.128/26192.168.0.191.129–.190
    4192.168.0.192/26192.168.0.255.193–.254
  5. ধার নেওয়া bit-এর binary: 00, 01, 10, 11 → শেষ octet শুরু হয় 0, 64, 128, 192-এ।
Q16. (Written, Real exam style) What is the difference between NAT and PAT? A home has 8 devices but the ISP gives only one public IP — which one is being used, and how does the router deliver replies to the correct device? Give a small example mapping.
Q16. (লিখিত, Real exam style) NAT আর PAT-এর মধ্যে পার্থক্য কী? একটা বাসায় 8টা device আছে কিন্তু ISP মাত্র একটা public IP দেয় — এখানে কোনটা ব্যবহার হচ্ছে, আর router reply গুলো সঠিক device-এ কীভাবে পৌঁছে দেয়? ছোট একটা example mapping দিন।
Show Answerউত্তর দেখুন
Answer:
  1. NAT (basic/static): a one-to-one mapping — each private IP is translated to its own public IP. Only addresses change, ports stay the same. 8 devices would need 8 public IPs.
  2. PAT (NAT overload / NAPT): a many-to-one mapping — many private IPs share one public IP, and the router also rewrites the source port so each connection stays unique.
  3. The home is using PAT, because 8 devices share 1 public IP.
  4. How replies come back: the router keeps a translation table. Example with public IP 203.0.113.7:
    192.168.0.5:51000 -> 203.0.113.7:62001
    192.168.0.9:53344 -> 203.0.113.7:62002
    A reply arriving at port 62001 is looked up in the table and sent to 192.168.0.5:51000; port 62002 goes to 192.168.0.9:53344. The port number is the "return address tag."
Answer:
  1. NAT (basic/static): one-to-one mapping — প্রতিটা private IP নিজের আলাদা public IP-তে translate হয়। শুধু address বদলায়, port একই থাকে। 8টা device-এর জন্য 8টা public IP লাগত।
  2. PAT (NAT overload / NAPT): many-to-one mapping — অনেক private IP একটা public IP ভাগ করে, আর router source port-ও বদলে দেয় যাতে প্রতিটা connection আলাদা থাকে।
  3. বাসাটা PAT ব্যবহার করছে, কারণ 8টা device 1টা public IP ভাগ করছে।
  4. Reply কীভাবে ফেরে: router একটা translation table রাখে। Public IP 203.0.113.7 দিয়ে example:
    192.168.0.5:51000 -> 203.0.113.7:62001
    192.168.0.9:53344 -> 203.0.113.7:62002
    Port 62001-এ reply এলে table দেখে সেটা 192.168.0.5:51000-এ যায়; port 62002 যায় 192.168.0.9:53344-এ। Port number-টাই হলো "return address tag।"
Q17. (Written, Real exam style) A host is assigned the IP address 172.16.35.90/26 using CIDR notation. Find the subnet mask, the network address, the broadcast address, and the usable host range. Show the binary math.
Q17. (লিখিত, Real exam style) CIDR notation দিয়ে একটা host-কে IP address 172.16.35.90/26 দেওয়া হয়েছে। Subnet mask, network address, broadcast address আর usable host range বের করুন। Binary হিসাব দেখান।
Show Answerউত্তর দেখুন
Answer: mask 255.255.255.192, network 172.16.35.64, broadcast 172.16.35.127, hosts .65 – .126.
  1. Mask: /26 → 26 ones → 255.255.255.192. Host bits \( h = 32 - 26 = 6 \), block size \( 2^{6} = 64 \). Subnets: .0, .64, .128, .192.
  2. Binary of the last octet (first 2 bits network, last 6 host). 90 = 64 + 16 + 8 + 2:
    IP   .90   = 01 011010
    Mask .192  = 11 000000
    AND        = 01 000000 = 64  -> network = 172.16.35.64
  3. Broadcast: set the 6 host bits to 1 → 01 111111 = 64 + 63 = 127 → 172.16.35.127.
  4. Usable range: 172.16.35.65 to 172.16.35.126 = \( 2^{6} - 2 = 62 \) hosts. 90 sits inside, so the assignment is valid.
Answer: mask 255.255.255.192, network 172.16.35.64, broadcast 172.16.35.127, host .65 – .126
  1. Mask: /26 → 26টা 1 → 255.255.255.192। Host bit \( h = 32 - 26 = 6 \), block size \( 2^{6} = 64 \)। Subnet: .0, .64, .128, .192।
  2. শেষ octet-এর binary (প্রথম 2 bit network, শেষ 6 bit host)। 90 = 64 + 16 + 8 + 2:
    IP   .90   = 01 011010
    Mask .192  = 11 000000
    AND        = 01 000000 = 64  -> network = 172.16.35.64
  3. Broadcast: 6টা host bit 1 করুন → 01 111111 = 64 + 63 = 127 → 172.16.35.127
  4. Usable range: 172.16.35.65 থেকে 172.16.35.126 = \( 2^{6} - 2 = 62 \)টা host। 90 এর ভিতরে আছে, তাই assignment-টা valid।
Q18. (Written, Real exam style) A 500-byte packet is sent over a 2 Mbps link. The link is 400 km long and the signal travels at \( 2 \times 10^{8} \) m/s. Ignore queuing and processing delay. Find the transmission delay, the propagation delay, and the total time for the packet to fully arrive. Then say what happens to each delay if the bandwidth is doubled to 4 Mbps.
Q18. (লিখিত, Real exam style) 500-byte-এর একটা packet 2 Mbps link দিয়ে পাঠানো হলো। Link-টা 400 km লম্বা আর signal চলে \( 2 \times 10^{8} \) m/s গতিতে। Queuing আর processing delay বাদ দিন। Transmission delay, propagation delay আর packet পুরোপুরি পৌঁছাতে মোট সময় বের করুন। তারপর বলুন bandwidth দ্বিগুণ করে 4 Mbps করলে কোন delay-র কী হবে।
Show Answerউত্তর দেখুন
Answer: \( d_{trans} = 2 \) ms, \( d_{prop} = 2 \) ms, total = 4 ms.
  1. Transmission: \( L = 500 \times 8 = 4000 \) bits, \( R = 2 \times 10^{6} \) bps. \( d_{trans} = 4000 / (2 \times 10^{6}) = 2 \times 10^{-3} \) s = 2 ms.
  2. Propagation: \( d = 400 \) km \( = 4 \times 10^{5} \) m. \( d_{prop} = 4 \times 10^{5} / (2 \times 10^{8}) = 2 \times 10^{-3} \) s = 2 ms.
  3. Total: \( 2 + 2 = \) 4 ms (last bit leaves at 2 ms, then travels 2 ms more).
  4. Double the bandwidth: \( d_{trans} \) halves to 1 ms (it depends on \( R \)), but \( d_{prop} \) stays exactly 2 ms — it depends only on distance and medium. New total = 3 ms.
Answer: \( d_{trans} = 2 \) ms, \( d_{prop} = 2 \) ms, মোট = 4 ms।
  1. Transmission: \( L = 500 \times 8 = 4000 \) bits, \( R = 2 \times 10^{6} \) bps। \( d_{trans} = 4000 / (2 \times 10^{6}) = 2 \times 10^{-3} \) s = 2 ms
  2. Propagation: \( d = 400 \) km \( = 4 \times 10^{5} \) m। \( d_{prop} = 4 \times 10^{5} / (2 \times 10^{8}) = 2 \times 10^{-3} \) s = 2 ms
  3. মোট: \( 2 + 2 = \) 4 ms (শেষ bit-টা 2 ms-এ তার ছাড়ে, তারপর আরও 2 ms চলে)।
  4. Bandwidth দ্বিগুণ করলে: \( d_{trans} \) অর্ধেক হয়ে 1 ms হবে (এটা \( R \)-এর উপর নির্ভর করে), কিন্তু \( d_{prop} \) ঠিক 2 ms-ই থাকবে — এটা শুধু distance আর medium-এর উপর নির্ভর করে। নতুন মোট = 3 ms।
Q19. (Real exam style) A walkie-talkie lets both people talk, but only one at a time. A TV broadcast only ever goes one way. A phone call lets both people talk at the same time. In order, these three are examples of:
  • (a) Simplex, half-duplex, full-duplex
  • (b) Half-duplex, simplex, full-duplex
  • (c) Full-duplex, simplex, half-duplex
  • (d) Half-duplex, full-duplex, simplex
Q19. (Real exam style) Walkie-talkie-তে দুইজনই কথা বলতে পারে, কিন্তু একবারে একজন। TV broadcast সবসময় শুধু এক দিকে যায়। Phone call-এ দুইজন একসাথে কথা বলতে পারে। ক্রম অনুযায়ী এই তিনটা কীসের example?
  • (a) Simplex, half-duplex, full-duplex
  • (b) Half-duplex, simplex, full-duplex
  • (c) Full-duplex, simplex, half-duplex
  • (d) Half-duplex, full-duplex, simplex
Show Answerউত্তর দেখুন
Answer: (b) — walkie-talkie = half-duplex (both directions, one at a time); TV broadcast = simplex (one direction only, the viewer can never send back); phone call = full-duplex (both directions at the same time). Bonus link to Ethernet: old shared CSMA/CD Ethernet was half-duplex; modern switched Ethernet is full-duplex, which is why collisions — and CSMA/CD — disappeared.
Answer: (b) — walkie-talkie = half-duplex (দুই দিকে, একবারে একটা); TV broadcast = simplex (শুধু এক দিকে, দর্শক কখনো ফেরত পাঠাতে পারে না); phone call = full-duplex (একই সময়ে দুই দিকে)। Ethernet-এর সাথে bonus link: পুরনো shared CSMA/CD Ethernet ছিল half-duplex; আধুনিক switched Ethernet full-duplex — এই কারণেই collision আর CSMA/CD দুটোই হারিয়ে গেছে।