CPSC317 tutorial #3 - Protocol layers, RFC959, and other boring things by techmaster

VIEWS: 12 PAGES: 12

									                         Last heads up!
                              Protocols




                     CPSC317 tutorial #3
         Protocol layers, RFC959, and other boring things


                           Matt Hoffman1
                        hoffmanm@cs.ubc.ca

                      The University of British Columbia


                              May 16, 2006



1
                                 a
    Based on slides from Petter H¨ggholm
                           M. Hoffman      CPSC317 tutorial #3
                            Last heads up!
                                             Assignment #1
                                 Protocols




Assignment #1


    ◮   Your proxy will basically take an HTTP request, send it off,
        get the result, and return that.
    ◮   You’re just an intermediary.
    ◮   If you’re interested, you can look at www.w3.org for the
        HTTP request format.
          ◮   That’s not the main point, though.
          ◮   You mainly need to look at the Host field.




                              M. Hoffman      CPSC317 tutorial #3
                             Last heads up!
                                              Assignment #1
                                  Protocols




Makefiles. . .


     ◮   Your Makefiles can be very simple
     ◮   Everything can be recompiled at every make
     ◮   The main concern is that proxy is compiled when the marker
         types “make”
     ◮   Remember:
           ◮   Makefiles express dependencies.
           ◮   Use hard-tabs.




                               M. Hoffman      CPSC317 tutorial #3
                          Last heads up!
                                           Assignment #1
                               Protocols




Where to find info


    ◮   man pages!
    ◮   man pages!
    ◮   If you know the function, man it.
    ◮   If you need to know about a struct, man a function that uses
        it.
    ◮   Usually (almost always) the man-pages will tell you the
        includes you need.




                            M. Hoffman      CPSC317 tutorial #3
                                             Protocol stacks
                            Last heads up!   The OSI protocol stack
                                 Protocols   RFCs
                                             Ad-hoc standards



Protocol stacks



    ◮   Network protocols tend to be organised in stacks.
          ◮   Easy modularization
          ◮   Each layer can communicate above/below itself

    ◮   You have seen the TCP/IP protocol stack (hopefully. . . )
    ◮   This is the protocol stack used in practice on the internet.




                              M. Hoffman      CPSC317 tutorial #3
                                              Protocol stacks
                             Last heads up!   The OSI protocol stack
                                  Protocols   RFCs
                                              Ad-hoc standards



The OSI protocol stack

    ◮   The first formal protocol stack was the OSI model
    ◮   An ISO “standard”
    ◮   It took so long to implement that TCP/IP was invented and
        implemented in the meanwhile.
    ◮   Why should you care about OSI? And why should you bother
        listening to me?
          ◮   OSI has a “stricter” layering and is often useful for illustrating
              concepts.
          ◮   A lot of literature discusses the OSI stack rather than TCP/IP,
              so it’s good to know about it!



                               M. Hoffman      CPSC317 tutorial #3
                                  Protocol stacks
                 Last heads up!   The OSI protocol stack
                      Protocols   RFCs
                                  Ad-hoc standards



The OSI layers




                   M. Hoffman      CPSC317 tutorial #3
                                  Protocol stacks
                 Last heads up!   The OSI protocol stack
                      Protocols   RFCs
                                  Ad-hoc standards



The OSI layers




                   M. Hoffman      CPSC317 tutorial #3
                                          Protocol stacks
                         Last heads up!   The OSI protocol stack
                              Protocols   RFCs
                                          Ad-hoc standards



Detailed look at TCP/IP



    Layer         Implementation
    Application   FTP, HTTP, IMAP, POP3, SMTP, SSH, TELNET
    Transport     TCP, UDP, DCCP
    Network       IP (IPv4, IPv6)
    Link          Ethernet, Wi-Fi, PPP
    Physical      100BASE-T, 802.11*, Carrier Pigeon, Congo Drum




                           M. Hoffman      CPSC317 tutorial #3
                                              Protocol stacks
                             Last heads up!   The OSI protocol stack
                                  Protocols   RFCs
                                              Ad-hoc standards



RFCs (and why they’re helpful)

    ◮   What is an RFC, and since you don’t need any for the
        assignment, why should you care?
    ◮   “RFC” stands for “Request For Comments”
          ◮   Internet Society RFCs are memos describing various
              technologies.
          ◮   RFCs are less formal than “standards”.
          ◮   (Petter claims they’re less dry and boring. I’d say they’re
              equally, or maybe slightly less dry and boring.)

    ◮   Most of the useful and practical protocols in use on the
        internet are defined in RFCs.
          ◮   HTTP, IRC, FTP, IMAP. . .


                               M. Hoffman      CPSC317 tutorial #3
                                             Protocol stacks
                            Last heads up!   The OSI protocol stack
                                 Protocols   RFCs
                                             Ad-hoc standards



More on RFCs



    ◮   All the RFCs are available from
        http://www.rfc-editor.org/rfc.html
    ◮   Armed only with freely available RFCs, you can communicate
        with virtually any server on the internet!
          ◮   A nice programming language helps, too.
          ◮   But usually, you can get by with telnet.
          ◮   It’s not a bad idea to have telnet around, just in case.




                              M. Hoffman      CPSC317 tutorial #3
                                              Protocol stacks
                             Last heads up!   The OSI protocol stack
                                  Protocols   RFCs
                                              Ad-hoc standards



The wonderful world of ad-hoc standards

    ◮   In a perfect world, everyone would follow published standards
          ◮   All your problems (bugs) would be your fault
          ◮   Just follow the standard

    ◮   In the the real world, this isn’t the case
          ◮   Still, 95% or more of your bugs will be your fault, but. . .
          ◮   Sometimes they can be caused by deviations from standard
              protocols (on either side).
          ◮   See also: Internet Explorer, IRC, and many others.

    ◮   Be prepared for this. Examine communications.
          ◮   Learn to love human-readable data formats.
          ◮   If you use encrypted data streams. . . don’t come crying to me.


                               M. Hoffman      CPSC317 tutorial #3

								
To top