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) |
|---|---|---|---|---|
| 7 | Application | Services for the user's programsUser-এর program-এর জন্য service | HTTP, FTP, SMTP, DNS, DHCP | Data |
| 6 | Presentation | Data format, encryption, compressionData format, encryption, compression | SSL/TLS, JPEG, ASCII | Data |
| 5 | Session | Start, manage, and end sessionsSession শুরু, চালানো এবং শেষ করা | NetBIOS, RPC, sockets | Data |
| 4 | Transport | End-to-end delivery, reliability, portsEnd-to-end delivery, reliability, port | TCP, UDP | Segment (TCP) / Datagram (UDP)Segment (TCP) / Datagram (UDP) |
| 3 | Network | Logical (IP) addressing and routingLogical (IP) addressing এবং routing | IP, ICMP, OSPF; Router | Packet |
| 2 | Data Link | Framing, MAC addressing, error detectionFraming, MAC addressing, error detection | Ethernet, PPP, ARP; Switch | Frame |
| 1 | Physical | Send raw bits over a wire or airতার বা বাতাস দিয়ে raw bit পাঠানো | Cables, fiber, Wi-Fi radio; Hub, RepeaterCable, fiber, Wi-Fi radio; Hub, Repeater | Bit |
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, Session | Application | Application |
| Transport | Transport | Transport |
| Network | Internet | Network |
| Data Link | Network Access (Link) | Data Link |
| Physical | Physical |
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)।
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-ই হয়।
| 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ভালো — অংশে অংশে বাড়ানো যায় |
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 + SFD | 8 bytes | Wakes up the receiver, marks frame startReceiver-কে জাগায়, frame-এর শুরু বোঝায় |
| Destination MAC | 6 bytes | Who should receive the frameFrame-টা কে পাবে |
| Source MAC | 6 bytes | Who sent the frameFrame-টা কে পাঠালো |
| Type / Length | 2 bytes | What is inside (e.g., 0x0800 = IPv4, 0x0806 = ARP)ভিতরে কী আছে (যেমন 0x0800 = IPv4, 0x0806 = ARP) |
| Payload | 46–1500 bytes | The actual data (IP packet). Max 1500 = MTUআসল data (IP packet)। Max 1500 = MTU |
| FCS (CRC) | 4 bytes | Error check value (CRC-32)Error check value (CRC-32) |
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:
- Carrier Sense: listen first. If the wire is busy, wait.
- Multiple Access: many computers share the same wire.
- 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-এ ধাক্কা লাগে — একে বলে collision। CSMA/CD (Carrier Sense Multiple Access with Collision Detection) এটা সামলায়:
- Carrier Sense: আগে শুনুন। Wire busy থাকলে অপেক্ষা করুন।
- Multiple Access: অনেক computer একই wire ভাগ করে ব্যবহার করে।
- 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 |
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 জানে।
- PC-A checks its ARP cache. No entry for 192.168.1.20.
- 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."
- Every device on the LAN receives it. Only PC-B answers.
- PC-B sends an ARP Reply directly (unicast) to PC-A: "192.168.1.20 is at 08:00:27:AB:CD:EF."
- PC-A saves this in its ARP cache and now sends the real frame to that MAC.
- PC-A তার ARP cache দেখে। 192.168.1.20-এর কোনো entry নেই।
- PC-A একটা ARP Request broadcast করে (dest MAC = FF:FF:FF:FF:FF:FF): "192.168.1.20 কার? 192.168.1.10-কে জানাও।"
- LAN-এর সব device এটা পায়। শুধু PC-B উত্তর দেয়।
- PC-B সরাসরি (unicast) PC-A-কে ARP Reply পাঠায়: "192.168.1.20 আছে 08:00:27:AB:CD:EF-এ।"
- PC-A এটা ARP cache-এ রেখে দেয়, এবং এখন আসল frame ওই MAC-এ পাঠায়।
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) এটা ব্যবহার করে।
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.1011001। 1-এর সংখ্যা = 4 (এমনিতেই even)। তাই parity bit = 0। আমরা পাঠাই 10110010। Data যদি হতো 1011000 (তিনটা 1, odd), তাহলে parity bit = 1, যাতে সংখ্যাটা even হয়।1001 and 1100.
- Add: 1001 + 1100 = 1 0101. Carry (1) wraps around: 0101 + 1 =
0110. - Checksum = 1's complement of 0110 =
1001. Send it with the data. - Receiver adds all three: 1001 + 1100 + 1001 = ... after wraparound the sum becomes
1111(all 1s) → no error detected.
1001 আর 1100।
- যোগ: 1001 + 1100 = 1 0101। Carry (1) ঘুরে এসে যোগ হয়: 0101 + 1 =
0110। - Checksum = 0110-এর 1's complement =
1001। Data-র সাথে এটাও পাঠান। - Receiver তিনটাই যোগ করে: 1001 + 1100 + 1001 = ... wraparound-এর পরে sum হয়
1111(সব 1) → কোনো error ধরা পড়েনি।
1101, Generator = 1011 (4 bits → CRC will be 3 bits).
- Append 3 zeros to the data:
1101000. - 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
- CRC =
001. Transmit1101001. - The receiver divides
1101001by1011. Remainder 0 → no error. Non-zero remainder → error.
1101, Generator = 1011 (4 bit → CRC হবে 3 bit)।
- Data-র শেষে 3টা zero বসান:
1101000। - 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
- CRC =
001। পাঠান1101001। - Receiver
1101001-কে1011দিয়ে ভাগ করে। Remainder 0 → error নেই। Remainder non-zero → error আছে।
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।
Address classesAddress class
| Class | First octet rangeপ্রথম octet-এর range | Default maskDefault mask | Useব্যবহার |
|---|---|---|---|
| A | 1 – 126 | 255.0.0.0 (/8) | Huge networksবিশাল network |
| B | 128 – 191 | 255.255.0.0 (/16) | Medium networksমাঝারি network |
| C | 192 – 223 | 255.255.255.0 (/24) | Small networksছোট network |
| D | 224 – 239 | — | Multicast |
| E | 240 – 255 | — | Reserved (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।
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 বিশ্লেষণ
192.168.10.0/26, find the mask, network address, broadcast address, and usable host range.
- Mask: /26 → 26 ones:
255.255.255.192. Host bits \( h = 32-26 = 6 \). - Block size: \( 2^{6} = 64 \). So subnets start every 64 in the last octet: .0, .64, .128, .192.
- 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 - Broadcast: set all 6 host bits to 1:
00 111111= 63 →192.168.10.63. - Usable hosts: \( 2^{6} - 2 = 62 \), from
192.168.10.1to192.168.10.62.
192.168.10.0/26-এর জন্য mask, network address, broadcast address আর usable host range বের করুন।
- Mask: /26 → 26টা 1:
255.255.255.192। Host bit \( h = 32-26 = 6 \)। - Block size: \( 2^{6} = 64 \)। তাই শেষ octet-এ প্রতি 64 পর পর subnet শুরু হয়: .0, .64, .128, .192।
- শেষ 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 - Broadcast: সব 6টা host bit 1 করুন:
00 111111= 63 →192.168.10.63। - 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-এর প্রিয়)
200.10.20.0/24 into 4 equal subnets.
- 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. - Host bits left: \( h = 32 - 26 = 6 \) → each subnet has \( 2^{6}-2 = 62 \) usable hosts.
- 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
| Subnet | Network | First host | Last host | Broadcast |
|---|---|---|---|---|
| 1 | 200.10.20.0/26 | .1 | .62 | .63 |
| 2 | 200.10.20.64/26 | .65 | .126 | .127 |
| 3 | 200.10.20.128/26 | .129 | .190 | .191 |
| 4 | 200.10.20.192/26 | .193 | .254 | .255 |
200.10.20.0/24-কে 4টা সমান subnet-এ ভাগ করুন।
- কয়টা bit ধার নিতে হবে? 4টা subnet দরকার। \( 2^{s} \ge 4 \Rightarrow s = 2 \)। নতুন prefix = 24 + 2 = /26, mask
255.255.255.192। - Host bit বাকি: \( h = 32 - 26 = 6 \) → প্রতিটা subnet-এ \( 2^{6}-2 = 62 \)টা usable host।
- শেষ octet-এ ধার নেওয়া 2 bit লিখুন (bold অংশটা subnet number):
Subnet 0: 00000000 = .0 Subnet 1: 01000000 = .64 Subnet 2: 10000000 = .128 Subnet 3: 11000000 = .192
| Subnet | Network | First host | Last host | Broadcast |
|---|---|---|---|---|
| 1 | 200.10.20.0/26 | .1 | .62 | .63 |
| 2 | 200.10.20.64/26 | .65 | .126 | .127 |
| 3 | 200.10.20.128/26 | .129 | .190 | .191 |
| 4 | 200.10.20.192/26 | .193 | .254 | .255 |
Worked example 3: which subnet does an IP belong to?Worked example 3: একটা IP কোন subnet-এ পড়ে?
172.16.77.10/20 belong to?
- /20 = 16 bits (first two octets) + 4 bits of the third octet. Mask =
255.255.240.0. - Only the third octet needs binary work. 77 =
01001101. - AND with the mask octet 240 =
11110000:77 = 0100 1101 240 = 1111 0000 AND = 0100 0000 = 64 - Network =
172.16.64.0/20. - Broadcast: set the 12 host bits to 1 → third octet
0100 1111= 79, fourth octet 255 →172.16.79.255. - Host range:
172.16.64.1–172.16.79.254. So yes, 172.16.77.10 is inside.
172.16.77.10/20 কোন network-এ পড়ে?
- /20 = 16 bit (প্রথম দুই octet) + তৃতীয় octet-এর 4 bit। Mask =
255.255.240.0। - শুধু তৃতীয় octet-এ binary-র কাজ লাগবে। 77 =
01001101। - Mask-এর octet 240 =
11110000-এর সাথে AND করুন:77 = 0100 1101 240 = 1111 0000 AND = 0100 0000 = 64 - Network =
172.16.64.0/20। - Broadcast: 12টা host bit 1 করুন → তৃতীয় octet
0100 1111= 79, চতুর্থ octet 255 →172.16.79.255। - Host range:
172.16.64.1–172.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-এ এসেছে)
192.168.10.45/27. Find the subnet (network IP), the broadcast address, and the usable host range.
- Mask: /27 → 27 ones →
255.255.255.224. Host bits \( h = 32 - 27 = 5 \). - Block size: \( 2^{5} = 32 \) (or 256 − 224 = 32). Subnets start at .0, .32, .64, .96, ...
- 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 - Network IP =
192.168.10.32/27. (Quick check: the biggest multiple of 32 that is ≤ 45 is 32.) - Broadcast: set all 5 host bits to 1 →
001 11111= 32 + 31 = 63 →192.168.10.63. - Usable host range:
192.168.10.33to192.168.10.62, which is \( 2^{5} - 2 = 30 \) hosts. So .45 is a valid host inside this subnet.
192.168.10.45/27। এর subnet (network IP), broadcast address আর usable host range বের করুন।
- Mask: /27 → 27টা 1 →
255.255.255.224। Host bit \( h = 32 - 27 = 5 \)। - Block size: \( 2^{5} = 32 \) (বা 256 − 224 = 32)। Subnet শুরু হয় .0, .32, .64, .96, ...-এ।
- শেষ 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 - Network IP =
192.168.10.32/27। (দ্রুত check: 45-এর চেয়ে ছোট বা সমান, 32-এর সবচেয়ে বড় গুণিতক হলো 32।) - Broadcast: সব 5টা host bit 1 করুন →
001 11111= 32 + 31 = 63 →192.168.10.63। - 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-এ এসেছে)
172.16.0.0/16). What subnet mask do you need to create 512 subnets?
- How many bits to borrow? We need \( 2^{s} \ge 512 \). Since \( 2^{9} = 512 \), borrow exactly s = 9 bits.
- New prefix: 16 + 9 = /25.
- Write the mask: /25 = 8 + 8 + 8 + 1 ones:
So the mask is 255.255.255.128.11111111.11111111.11111111.10000000 255 . 255 . 255 . 128 - Check the hosts left: \( h = 32 - 25 = 7 \) → \( 2^{7} - 2 = 126 \) usable hosts in each of the 512 subnets.
172.16.0.0/16)। 512টা subnet বানাতে কোন subnet mask লাগবে?
- কয়টা bit ধার নিতে হবে? দরকার \( 2^{s} \ge 512 \)। যেহেতু \( 2^{9} = 512 \), ঠিক s = 9টা bit ধার নিন।
- নতুন prefix: 16 + 9 = /25।
- Mask লিখুন: /25 = 8 + 8 + 8 + 1টা 1:
তাহলে mask হলো 255.255.255.128।11111111.11111111.11111111.10000000 255 . 255 . 255 . 128 - বাকি host check করুন: \( h = 32 - 25 = 7 \) → 512টা subnet-এর প্রতিটায় \( 2^{7} - 2 = 126 \)টা usable host।
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/24 | directly connecteddirectly connected | eth0 |
| 10.0.0.0/8 | 192.168.1.254 | eth0 |
| 0.0.0.0/0 (default)(default) | 203.0.113.1 | eth1 |
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)।
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
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
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 শুরু করতে পারে না।
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.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-ই সব সম্ভব করে।
203.0.113.7:
| Inside (private) | Translated (public) | Destination |
|---|---|---|
| 192.168.0.5:51000 | 203.0.113.7:62001 | 93.184.216.34:443 |
| 192.168.0.9:51000 | 203.0.113.7:62002 | 93.184.216.34:443 |
203.0.113.7 ভাগ করে:
| Inside (private) | Translated (public) | Destination |
|---|---|---|
| 192.168.0.5:51000 | 203.0.113.7:62001 | 93.184.216.34:443 |
| 192.168.0.9:51000 | 203.0.113.7:62002 | 93.184.216.34:443 |
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:
- SYN: client → server. "Let's talk. My starting sequence number is x."
- SYN + ACK: server → client. "OK. My starting number is y. I acknowledge yours: ack = x + 1."
- ACK: client → server. "Got it. ack = y + 1." Connection is now open.
TCP প্রতিটা connection শুরু করে তিনটা message দিয়ে:
- SYN: client → server। "চলো কথা বলি। আমার starting sequence number হলো x।"
- SYN + ACK: server → client। "ঠিক আছে। আমার starting number হলো y। তোমারটা পেয়েছি: ack = x + 1।"
- ACK: client → server। "পেয়েছি। ack = y + 1।" Connection এখন খোলা।
- Client → Server:
SYN, seq = 1000 - Server → Client:
SYN + ACK, seq = 5000, ack = 1001 - Client → Server:
ACK, seq = 1001, ack = 5001
- Client → Server:
SYN, seq = 1000 - Server → Client:
SYN + ACK, seq = 5000, ack = 1001 - Client → Server:
ACK, seq = 1001, ack = 5001
Closing a connection (teardown)Connection বন্ধ করা (teardown)
Closing normally takes 4 messages, because each side closes its own direction:
- A → B: FIN ("I am done sending.")
- B → A: ACK
- B → A: FIN ("I am done too.")
- A → B: ACK, then A waits in TIME_WAIT for a while before fully closing, in case the last ACK gets lost.
স্বাভাবিকভাবে বন্ধ করতে লাগে 4টা message, কারণ প্রতিটা পক্ষ নিজের দিকটা আলাদা করে বন্ধ করে:
- A → B: FIN ("আমার পাঠানো শেষ।")
- B → A: ACK
- B → A: FIN ("আমারও শেষ।")
- 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 পাওয়া যায়।
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.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
| TCP | UDP | |
|---|---|---|
| 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 |
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.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 বাছতে যে সময় নেয়।
- Transmission: \( L = 1000 \times 8 = 8000 \) bits, \( R = 10^{6} \) bps. \( d_{trans} = 8000 / 10^{6} = 8 \) ms.
- Propagation: \( d = 100 \) km \( = 10^{5} \) m. \( d_{prop} = 10^{5} / (2 \times 10^{8}) = 0.5 \) ms.
- Total: \( 8 + 0.5 = 8.5 \) ms.
- Transmission: \( L = 1000 \times 8 = 8000 \) bits, \( R = 10^{6} \) bps। \( d_{trans} = 8000 / 10^{6} = 8 \) ms।
- Propagation: \( d = 100 \) km \( = 10^{5} \) m। \( d_{prop} = 10^{5} / (2 \times 10^{8}) = 0.5 \) ms।
- Total: \( 8 + 0.5 = 8.5 \) ms।
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।
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অর্থ |
|---|---|---|---|
| GET | Read a resourceResource পড়া | 200 OK | Successসফল |
| POST | Send data / createData পাঠানো / create | 301 | Moved permanently (redirect)স্থায়ীভাবে সরানো (redirect) |
| PUT | Replace / updateReplace / update | 403 | Forbidden |
| DELETE | Removeমুছে ফেলা | 404 | Not Found |
| HEAD | Headers only, no bodyশুধু header, body না | 500 | Internal 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।
- Browser checks its own cache, then the OS cache. Not found.
- The PC asks its configured recursive resolver (often the ISP's, or 8.8.8.8).
- The resolver asks a root server: "www.example.com?" Root replies: "Ask the .com TLD servers, here they are."
- The resolver asks a .com TLD server. It replies: "Ask example.com's authoritative server, here it is."
- The resolver asks the authoritative server, which answers: "www.example.com is
93.184.216.34" (an A record). - The resolver caches the answer (for the TTL time) and returns it to the PC. The browser now connects to that IP.
- Browser নিজের cache দেখে, তারপর OS-এর cache। পাওয়া গেল না।
- PC তার set করা recursive resolver-কে জিজ্ঞেস করে (সাধারণত ISP-র, বা 8.8.8.8)।
- Resolver একটা root server-কে জিজ্ঞেস করে: "www.example.com?" Root বলে: ".com TLD server-দের জিজ্ঞেস করো, এই যে ঠিকানা।"
- Resolver একটা .com TLD server-কে জিজ্ঞেস করে। সে বলে: "example.com-এর authoritative server-কে জিজ্ঞেস করো, এই যে।"
- Resolver authoritative server-কে জিজ্ঞেস করে, আর সে উত্তর দেয়: "www.example.com হলো
93.184.216.34" (একটা A record)। - Resolver উত্তরটা cache করে রাখে (TTL সময় পর্যন্ত) আর PC-কে ফেরত দেয়। Browser এখন ওই IP-তে connect করে।
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:
- Discover — client broadcasts: "Any DHCP server here?"
- Offer — server replies: "You can have 192.168.1.50."
- Request — client broadcasts: "I accept 192.168.1.50."
- 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:
- Discover — client broadcast করে: "এখানে কোনো DHCP server আছে?"
- Offer — server উত্তর দেয়: "তুমি 192.168.1.50 নিতে পারো।"
- Request — client broadcast করে: "আমি 192.168.1.50 নিলাম।"
- 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, 21 | FTP | TCP | File transfer (20 data, 21 control)File transfer (20 data, 21 control) |
| 22 | SSH | TCP | Secure remote loginSecure remote login |
| 23 | Telnet | TCP | Remote login (insecure)Remote login (insecure) |
| 25 | SMTP | TCP | Sending emailEmail পাঠানো |
| 53 | DNS | UDP (TCP for big transfers)UDP (বড় transfer-এ TCP) | Name resolutionName resolution |
| 67, 68 | DHCP | UDP | Auto IP assignment (67 server, 68 client)Auto IP দেওয়া (67 server, 68 client) |
| 80 | HTTP | TCP | Web |
| 110 | POP3 | TCP | Email downloadEmail download |
| 143 | IMAP | TCP | Email syncEmail sync |
| 443 | HTTPS | TCP | Secure webSecure web |
| 3306 | MySQL | TCP | Database |
Practice Questions (Admission Style)Practice Questions (Admission Style)
Show Answerউত্তর দেখুন
Show Answerউত্তর দেখুন
Show Answerউত্তর দেখুন
Show Answerউত্তর দেখুন
Show Answerউত্তর দেখুন
Show Answerউত্তর দেখুন
- Host bits: \( h = 32 - 26 = 6 \).
- Total addresses: \( 2^{6} = 64 \).
- Subtract 2 (one network address, one broadcast address): \( 64 - 2 = 62 \) usable hosts.
- Host bit: \( h = 32 - 26 = 6 \)।
- মোট address: \( 2^{6} = 64 \)।
- 2টা বাদ দিন (একটা network address, একটা broadcast address): \( 64 - 2 = 62 \)টা usable host।
Show Answerউত্তর দেখুন
192.168.1.130/26, find the network address, broadcast address, and usable host range. Show the binary work.192.168.1.130/26 address-টার network address, broadcast address আর usable host range বের করুন। Binary হিসাব দেখান।Show Answerউত্তর দেখুন
192.168.1.128, broadcast 192.168.1.191, hosts .129 – .190.
- /26 → mask 255.255.255.192, host bits = 6, block size = 64. Subnets: .0, .64, .128, .192.
- Binary of the last octet: 130 =
10 000010. Mask 192 =11 000000. - AND them:
10 000000= 128 → network = 192.168.1.128. - Broadcast: host bits all 1 →
10 111111= 191 → 192.168.1.191. - Usable range: 129 to 190, which is \( 2^{6}-2 = 62 \) hosts.
192.168.1.128, broadcast 192.168.1.191, host .129 – .190।
- /26 → mask 255.255.255.192, host bit = 6, block size = 64। Subnet: .0, .64, .128, .192।
- শেষ octet-এর binary: 130 =
10 000010। Mask 192 =11 000000। - AND করুন:
10 000000= 128 → network = 192.168.1.128। - Broadcast: সব host bit 1 →
10 111111= 191 → 192.168.1.191। - Usable range: 129 থেকে 190, মানে \( 2^{6}-2 = 62 \)টা host।
Show Answerউত্তর দেখুন
Show Answerউত্তর দেখুন
- Client → Server:
SYN, seq = 5000 - Server → Client:
SYN + ACK, seq = 9000, ack = 5001(ack = client's seq + 1, because SYN consumes one number) - Client → Server:
ACK, seq = 5001, ack = 9001(ack = server's seq + 1)
- Client → Server:
SYN, seq = 5000 - Server → Client:
SYN + ACK, seq = 9000, ack = 5001(ack = client-এর seq + 1, কারণ SYN একটা নম্বর খরচ করে) - Client → Server:
ACK, seq = 5001, ack = 9001(ack = server-এর seq + 1)
Show Answerউত্তর দেখুন
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.192.168.4.0/24-কে 8টা সমান subnet-এ ভাগ করুন। নতুন prefix, প্রতি subnet-এ usable host সংখ্যা দিন, আর প্রথম তিনটা subnet-এর broadcast address সহ list করুন। Binary যুক্তি দেখান।Show Answerউত্তর দেখুন
- Need 8 subnets: \( 2^{s} \ge 8 \Rightarrow s = 3 \) borrowed bits. New prefix = 24 + 3 = /27 (mask 255.255.255.224).
- Host bits: \( 32 - 27 = 5 \) → usable hosts = \( 2^{5} - 2 = 30 \) per subnet.
- 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 - 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 - (The rest continue every 32: .96, .128, .160, .192, .224.)
- 8টা subnet দরকার: \( 2^{s} \ge 8 \Rightarrow s = 3 \)টা bit ধার। নতুন prefix = 24 + 3 = /27 (mask 255.255.255.224)।
- Host bit: \( 32 - 27 = 5 \) → প্রতি subnet-এ usable host = \( 2^{5} - 2 = 30 \)।
- Block size = \( 2^{5} = 32 \)। ধার নেওয়া 3 bit শেষ octet-এ 000, 001, 010, ... এভাবে গোনে:
000 00000 = .0 001 00000 = .32 010 00000 = .64 - 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 - (বাকিগুলো প্রতি 32 পর পর: .96, .128, .160, .192, .224।)
Show Answerউত্তর দেখুন
- 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 use? Which one does a packet for 10.2.7.9 use? Explain.- 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উত্তর দেখুন
- 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. - 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.
10.1.5.20-এর জন্য: R1 (/8), R2 (/16), R3 (/24), R4 (/0) সবগুলোই মেলে। Router সবচেয়ে লম্বা prefix নেয় → /24 → interface C।10.2.7.9-এর জন্য: R2 চায় 10.1.x.x (না), R3 চায় 10.1.5.x (না)। মেলে R1 (/8) আর R4 (/0)। লম্বাটা = /8 → interface A।
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.192.168.0.0/24 block আছে। তাদের 4টা department দরকার, প্রতিটায় কমপক্ষে 50টা host। Subnet design করুন: prefix দিন, 4টা network আর broadcast address দিন, আর দেখান কেন /27 কাজ করবে না।Show Answerউত্তর দেখুন
- 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.
- Subnet count check: /24 → /26 borrows 2 bits → \( 2^{2} = 4 \) subnets. Exactly what we need.
- Why /27 fails: /27 leaves 5 host bits → \( 2^{5} - 2 = 30 \) usable hosts < 50. Not enough, even though it gives 8 subnets.
- The 4 subnets (block size 64):
Dept Network Broadcast Hosts 1 192.168.0.0/26 192.168.0.63 .1–.62 2 192.168.0.64/26 192.168.0.127 .65–.126 3 192.168.0.128/26 192.168.0.191 .129–.190 4 192.168.0.192/26 192.168.0.255 .193–.254 - Binary of the borrowed bits:
00,01,10,11→ last octet starts 0, 64, 128, 192.
- 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।
- Subnet সংখ্যা check: /24 → /26 মানে 2 bit ধার → \( 2^{2} = 4 \)টা subnet। ঠিক যা দরকার।
- /27 কেন fail করে: /27-এ host bit থাকে 5টা → \( 2^{5} - 2 = 30 \)টা usable host < 50। যথেষ্ট না, যদিও subnet পাওয়া যায় 8টা।
- 4টা subnet (block size 64):
Dept Network Broadcast Host 1 192.168.0.0/26 192.168.0.63 .1–.62 2 192.168.0.64/26 192.168.0.127 .65–.126 3 192.168.0.128/26 192.168.0.191 .129–.190 4 192.168.0.192/26 192.168.0.255 .193–.254 - ধার নেওয়া bit-এর binary:
00,01,10,11→ শেষ octet শুরু হয় 0, 64, 128, 192-এ।
Show Answerউত্তর দেখুন
- 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.
- 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.
- The home is using PAT, because 8 devices share 1 public IP.
- How replies come back: the router keeps a translation table. Example with public IP 203.0.113.7:
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."192.168.0.5:51000 -> 203.0.113.7:62001 192.168.0.9:53344 -> 203.0.113.7:62002
- NAT (basic/static): one-to-one mapping — প্রতিটা private IP নিজের আলাদা public IP-তে translate হয়। শুধু address বদলায়, port একই থাকে। 8টা device-এর জন্য 8টা public IP লাগত।
- PAT (NAT overload / NAPT): many-to-one mapping — অনেক private IP একটা public IP ভাগ করে, আর router source port-ও বদলে দেয় যাতে প্রতিটা connection আলাদা থাকে।
- বাসাটা PAT ব্যবহার করছে, কারণ 8টা device 1টা public IP ভাগ করছে।
- Reply কীভাবে ফেরে: router একটা translation table রাখে। Public IP 203.0.113.7 দিয়ে example:
Port 62001-এ reply এলে table দেখে সেটা 192.168.0.5:51000-এ যায়; port 62002 যায় 192.168.0.9:53344-এ। Port number-টাই হলো "return address tag।"192.168.0.5:51000 -> 203.0.113.7:62001 192.168.0.9:53344 -> 203.0.113.7:62002
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.172.16.35.90/26 দেওয়া হয়েছে। Subnet mask, network address, broadcast address আর usable host range বের করুন। Binary হিসাব দেখান।Show Answerউত্তর দেখুন
255.255.255.192, network 172.16.35.64, broadcast 172.16.35.127, hosts .65 – .126.
- Mask: /26 → 26 ones →
255.255.255.192. Host bits \( h = 32 - 26 = 6 \), block size \( 2^{6} = 64 \). Subnets: .0, .64, .128, .192. - 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 - Broadcast: set the 6 host bits to 1 →
01 111111= 64 + 63 = 127 →172.16.35.127. - Usable range:
172.16.35.65to172.16.35.126= \( 2^{6} - 2 = 62 \) hosts. 90 sits inside, so the assignment is valid.
255.255.255.192, network 172.16.35.64, broadcast 172.16.35.127, host .65 – .126।
- Mask: /26 → 26টা 1 →
255.255.255.192। Host bit \( h = 32 - 26 = 6 \), block size \( 2^{6} = 64 \)। Subnet: .0, .64, .128, .192। - শেষ 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 - Broadcast: 6টা host bit 1 করুন →
01 111111= 64 + 63 = 127 →172.16.35.127। - Usable range:
172.16.35.65থেকে172.16.35.126= \( 2^{6} - 2 = 62 \)টা host। 90 এর ভিতরে আছে, তাই assignment-টা valid।
Show Answerউত্তর দেখুন
- 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.
- 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.
- Total: \( 2 + 2 = \) 4 ms (last bit leaves at 2 ms, then travels 2 ms more).
- 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.
- 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।
- 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।
- মোট: \( 2 + 2 = \) 4 ms (শেষ bit-টা 2 ms-এ তার ছাড়ে, তারপর আরও 2 ms চলে)।
- Bandwidth দ্বিগুণ করলে: \( d_{trans} \) অর্ধেক হয়ে 1 ms হবে (এটা \( R \)-এর উপর নির্ভর করে), কিন্তু \( d_{prop} \) ঠিক 2 ms-ই থাকবে — এটা শুধু distance আর medium-এর উপর নির্ভর করে। নতুন মোট = 3 ms।