@@ -0,0 +1,1407 @@
+#This python code shows the same implementation of the rfc downloader assuming HTTP was brand new and there was%0A#no module (the %22urllib%22 module,i meant) in Python that could do the magic for us.%0A#Here, we step down one step in the protocol stack and use TCP to to download the required RFC document.%0A%0A#The Internet is like a cake with many layers, now these layers we're talking about is an analogy to the Internet protocol suite that works%0A#with each other to get packets delivered from one place to another.%0A%0A#Python provides modules to interface with different protocols.%0A%0Aimport sys,socket    #we had imported a different module in the previous program and that handled all the HTTP header for us.%0A%0Atry:%0A    rfc_number=int(sys.argv%5B1%5D)%0Aexcept (IndexError, ValueError):%0A    print('Please supply an RFC number as an argument.')%0A    sys.exit(2)%0A    %0A host = 'www.ietf.org'%0A port = 80%0A socket = socket.create_connection((host,port))%0A %0A req = (%0A     'GET /rfc/rfc%7Brfcnum%7D.txt HTTP/1.1%5Cr%5Cn'%0A     'Host: %7Bhost%7D:%7Bport%7D%5Cr%5Cn'%0A     'User-Agent: Python %7Bversion%7D%5Cr%5Cn'%0A     'Connection: close%5Cr%5Cn'%0A     '%5Cr%5Cn'%0A )%0A %0A req=req.format(%0A     rfcnum=rfc_number,%0A     host=host,%0A     port=port,%0A     version=sys.version_info%5B0%5D%0A)%0A%0Asocket.sendall(req.encode('ascii'))%0Arfc_raw = bytearray()%0Awhile True:%0A    buf = sock.recv(4096)%0A    if not len(buf):%0A        break%0A    rfc_raw += buf%0Arfc = rfc_raw.decode('utf-8')%0Aprint(rfc)%0A%0A

Create rfc_downloader_a_level_down.py