मुख्य सामग्री पर जाएँ

सिलेबस · CS कंप्यूटर विज्ञान और सूचना प्रौद्योगिकी

विषय के सभी टॉपिक
C प्रोग्रामिंग की बुनियाद7
ऐरे और पॉइंटर9
रिकर्शन6
प्रायिकता और सांख्यिकी की बुनियाद9
डेटाबेस सिस्टम की बुनियाद15
रैखिक बीजगणित की बुनियाद6
कंप्यूटर नेटवर्क की बुनियाद9
कलन की बुनियाद6
संगणना सिद्धांत की बुनियाद9
कंपाइलर डिज़ाइन की बुनियाद9
लिंक्ड लिस्ट, स्टैक और क्यू5
ट्री, बाइनरी सर्च ट्री और हीप4
ग्राफ की बुनियाद3
एल्गोरिदम की बुनियाद15
असतत गणित की बुनियाद18
डिजिटल लॉजिक की बुनियाद22
कंप्यूटर संगठन की बुनियाद12
ऑपरेटिंग सिस्टम की बुनियाद15

Network layers, services और encapsulation

पाठ 147 / 1797 मिनटमुफ़्त

लक्ष्य और model

Layer की service समझें, service और protocol अलग करें तथा routed path पर headers trace करें। पूर्वज्ञान: bits, bytes और binary arithmetic। सामान्य unicast IPv4 over Ethernet मानें; tunnelling, NAT, VLAN tags, IP options और fragmentation तभी हों जब प्रश्न कहे। Size में चुपचाप preamble या inter-frame gap न जोड़ें।

1. Layering क्यों उपयोगी है

हर layer ऊपर वाली layer को service देती और नीचे वाली का उपयोग करती है। Protocol peer entities के बीच message format और नियम बताता है; service interface बताता है कि स्थानीय ऊपर वाली layer क्या माँग सकती है। Application transport से bytes भेजने को कह सकती है, बिना network card की signalling बनाए। Peer communication तार्किक है: वास्तविक data पहले sender के stack में नीचे, फिर links/devices से होकर receiver के stack में ऊपर जाता है।

OSI model में नीचे से सात layers हैं: physical में signals/bits; data link में एक link के frames; network में अलग networks के बीच packet forwarding; transport में process-to-process communication; session में संवाद का समन्वय; presentation में representation/encoding; application में application protocols। ये functional categories हैं; हर Internet program में सात अलग software modules जरूरी नहीं।

चार-layer TCP/IP model में link, Internet, transport और application हैं। पाँच-layer teaching model physical को link से अलग रखता है। Layers गिनने से पहले convention लिखें। OSI session/presentation के काम Internet में अक्सर applications या libraries करते हैं; उनके लिए अलग अनिवार्य headers नहीं बनते। TCP/UDP transport, IP Internet, Ethernet link तथा DNS/HTTP application protocols हैं।

2. Encapsulation और demultiplexing

नीचे वाली layer ऊपर के पूरे unit को payload मानकर अपना control information जोड़ती है; कभी trailer भी होता है। Receiver पर Ethernet EtherType network protocol चुनता है; IPv4 Protocol field TCP/UDP जैसे transport protocol को पहचानता है; destination port receiving endpoint/application चुनने में मदद करता है। Port, IP address और Ethernet address अलग identifiers हैं।

हल किया हिसाब: application के 1000 bytes, TCP header 20 और IPv4 header 20 bytes हैं। TCP segment=1020; IP datagram=1040 bytes। बताए गए Ethernet header 14 तथा FCS 4 bytes जोड़ने पर destination MAC से FCS तक 1058 bytes हैं। Application-data fraction=1000/1058≈94.52%। यह physical-wire utilization नहीं है: preamble, inter-frame gap, ACK और retransmission बाहर रखे हैं। IP total length में IP header आता है, Ethernet overhead नहीं। FCS error detection है, application data नहीं।

3. Router पार करते हुए packet

Host A और B अलग Ethernet networks में हैं तथा बीच में router R है। A के IP packet का destination B का IP है। पहले link के frame का destination MAC, R के स्थानीय interface का है; next-hop resolution इसे खोजती है। R frame हटाता है, IP header जाँचता/process करता है, route से outgoing next hop चुनता है और नया frame बनाता है। यदि B सीधे जुड़ा है तो दूसरे frame का source MAC R के outgoing interface का और destination MAC B का होगा। No-NAT assumption में IP source/destination A/B रहते हैं; TTL घटता है और IPv4 checksum बदलते header के अनुसार update होता है। IP addresses समान रहने का अर्थ सभी header bits समान रहना नहीं।

Bridge/switch सामान्यतः LAN में destination MAC से forwarding करता है; transport connection समाप्त नहीं करता। Router network destination और routing table से निर्णय करता है। Hub/repeater signals दोहराता है, ऐसे forwarding निर्णय नहीं करता। एक वास्तविक device कई roles निभा सकती है; प्रश्न में बताए function से classification करें।

4. Reliability service की विशेषता है

IP best-effort datagrams देता है: loss, duplication और reordering संभव हैं। TCP sequence numbers, ACK और retransmissions से ordered reliable byte stream देता है; connection fail फिर भी हो सकता है। UDP datagram boundaries रखता है लेकिन खुद retransmission या ordered delivery की गारंटी नहीं देता। Application UDP के ऊपर ये काम जोड़ सकती है। Link या TCP checksum encryption और sender identity का प्रमाण नहीं।

उदाहरण: खराब frame detect करके discard हुआ। गलत frame नहीं पहुँचा, लेकिन packet अब गायब है; error detection ने recovery नहीं की। Recovery के लिए किसी उपयुक्त layer पर retransmission चाहिए। Layering का अर्थ हर layer में हर function दोहराना नहीं।

सामान्य गलतियाँ

  • प्रश्न का चार/पाँच/सात-layer model चुनें; counts न मिलाएँ।
  • अंतिम destination IP और अगले hop का MAC अलग रखें।
  • Size में measurement boundary तथा बताए overhead ही लें।
  • Router link encapsulation बदलता है; सामान्य forwarding TCP endpoints नहीं बदलती।
  • Reliability से निश्चित delay, सदा उपलब्ध connection या confidentiality सिद्ध नहीं होती।

मौलिक अभ्यास: छह single-correct MCQ

ये मौलिक शिक्षण प्रश्न हैं, पिछले वर्षों के प्रश्न नहीं। ठीक एक उत्तर चुनें।

P01. सामान्य IPv4 packet में TCP और UDP का चयन किस field से होता है?

A. EtherType B. Protocol C. Destination MAC D. FCS

उत्तर: B

A: EtherType network protocol चुनता है।

B: IPv4 Protocol अगला protocol पहचानता है।

C: MAC link recipient पहचानता है।

D: FCS frame error detect करता है।

P02. 500-byte payload में TCP 20, IP 20 और Ethernet overhead 18 bytes है। Frame size?

A. 520 bytes B. 540 bytes C. 558 bytes D. 518 bytes

उत्तर: C

A: यह केवल TCP जोड़ता है।

B: Ethernet छूट गया।

C: 500+20+20+18=558 bytes।

D: TCP और IP दोनों छूटे हैं।

P03. A, router R से off-link B को भेजता है; NAT नहीं। Destination IP और पहले link का destination MAC किसके हैं?

A. B और R B. R और B C. B और B D. R और R

उत्तर: A

A: IP B का; पहला Ethernet hop R है।

B: Endpoint और next hop उलट गए।

C: B पहले link पर सीधे नहीं है।

D: IP destination B है, R नहीं।

P04. नीचे से ऊपर सात-layer OSI क्रम कौन-सा है?

A. Physical, network, link, transport, session, presentation, application B. Physical, link, network, session, transport, presentation, application C. Application, presentation, session, transport, network, link, physical D. Physical, link, network, transport, session, presentation, application

उत्तर: D

A: Link network से नीचे है।

B: Transport session से नीचे है।

C: यह ऊपर से नीचे का क्रम है।

D: यही नीचे से ऊपर क्रम है।

P05. Error-detecting receiver खराब frame discard करता है। क्या अनिवार्यतः सही है?

A. Sender ने दोबारा भेज दिया है B. Receiver ने हर खराब bit सुधार दिया है C. केवल detection से discard हुआ data recover नहीं हुआ है D. Data encrypted है

उत्तर: C

A: Retransmission के लिए और mechanism चाहिए।

B: Discard correction नहीं।

C: Recovery के लिए अलग protocol behaviour चाहिए।

D: Detection encryption नहीं है।

P06. Protocol और service interface का सही अंतर?

A. दोनों का अर्थ केवल cable signalling है B. Protocol peers के नियम तय करता है; service interface स्थानीय layers की interaction तय करता है C. Service केवल remote packet headers बताती है D. Protocol हमेशा application API होता है

उत्तर: B

A: Protocols physical signalling से ऊपर भी हैं।

B: Peer नियम तथा local requests अलग हैं।

C: Interface local operations बताता है।

D: API interface है; हर protocol API नहीं।

स्रोत और दायरा

यह 2026 course के बताए भाग का पाठ है, पूरे Computer Networks syllabus की समाप्ति नहीं। सभी गणनात्मक उदाहरण और प्रश्न मौलिक हैं। 2027 की पूर्णता का दावा नहीं।

प्रगति सहेजने के लिए साइन इन करें। साइन इन