1 / 21

Overlay Network and Packet header

Overlay Network and Packet header. P resenter : 曾家豪 695430054. outline. O verview Overlay Network Overlay Network Architecture in Project P2P module in NS2 :GnutellaSim K-cube in Overlay Network About Packet Header Packet Class A ssign or Change Data to Header fields

sereno
Download Presentation

Overlay Network and Packet header

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Overlay Network and Packet header Presenter: 曾家豪 695430054

  2. outline • Overview Overlay Network • Overlay Network Architecture in Project • P2P module in NS2 :GnutellaSim • K-cube in Overlay Network • About Packet Header • Packet Class • Assign or Change Data to Header fields • How to add own Packet Header fields

  3. Overview Overlay Network Overlay: a network on top of another (IP) networks – links on one layer are network segments of lower layers – tunneling, application adaptor, transparent router Make the application control the routing

  4. Overlay Network Architecture in Project

  5. P2P module in NS2 :GnutellaSim • http://www.cc.gatech.edu/computing/compass/gnutella/install.html

  6. GnutellaSim Part I: Application Layer PeerApp-------------------GnutellaApp ActivityController PeerSys BootstrapControl--------SmpBootServer • PDNSBootServer Part II: Protocol Layer PeerAgent-----------------GnutellaAgent MsgParser-----------------GnutellaMsg Part III: Socket Adaptation Layer NSSocket • PrioSocket AdvwTcp • SocketTcp

  7. 010 XOR) 110 100 010 XOR) 000 010 010 XOR) 100 110 K-cube algorithmin Overlay Network 011 111 S 010 110 001 101 000 100

  8. 封包傳送出去之流程 Application/FTP start Agent(Agent/TCP) ;:send(p,h) Classifier ::recv(p,h) RTAgent ::recv(p,h) LL ::sendDown(p,h) Mac ::recv(p,h)

  9. About Packet Header

  10. EX: RTP Header (rtp.h)

  11. RTP Header (rtp.cc)

  12. Packet Header在NS2中的特性 • By default, ns includes ALL packet headers of ALL protocols in ns in EVERY packet in your simulation. If you are doing large-scale web traffic simulation with many big fat pipes, reducing unused packet headers can lead to major memory saving. The size of packet headers of all protocols in ns is about 1.9KB; however,if you turn on only the common header, the IP header and the TCP header, they add up to about 100 bytes. remove-packet-header AODV ARP ...... set ns [new Simulator] remove-all-packet-headers add-packet-header IP TCP ...... set ns [new Simulator]

  13. 如何增加自己的Packet Header fields 1.要增加Header fields於哪裡? • Common header • IP header • TCP or RTP header • New your packet type, protocol 2.是否有定義新增的Header fields offset_與access方式 3.Assign 值的方式

  14. EX: IP Header (ip.h)

  15. IP Header (ip.cc)

  16. EX: 設定或修改field的值 PriQueue::recv(Packet *p, Handler *h) { struct hdr_cmn *ch = HDR_CMN(p); struct hdr_ip *ih = HDR_IP(p); struct forkcube fk; if(Prefer_Routing_Protocols) { switch(ch->ptype()) { … default: Queue::recv(p, h); fk.uid = ch->uid(); fk.uid = fk.uid+1 cout<<"the unique id "<<fk.uid <<endl; cout<<"the source "<<( fk.srcaddr = ih->saddr() )<<endl; cout<<"the destination "<<( fk.dstaddr = ih->daddr() )<<endl; In ns-2.31/queue/priqueue.cc #include “packet.h“ #include “ip.h“ #include "priqueue.h" using namespace std; struct forkcube { int32_t srcaddr; int32_t dstaddr; int uid; };

  17. Packet type & packet header type In packet.h enum packet_t { PT_TCP, PT_UDP, PT_CBR, PT_AUDIO, PT_VIDEO, PT_ACK, PT_START, PT_STOP, PT_PRUNE, PT_GRAFT, PT_GRAFTACK, PT_JOIN, …… In ns-packet.tcl foreach prot { Common Flags IP # IP # Routing Protocols: NV # NixVector classifier for stateless routing rtProtoDV # distance vector routing protocol rtProtoLS # link state routing protocol SR # source routing, dsr/hdr_sr.cc Src_rt # source routing, src_rtg/hdr_src.cc # Routers: LDP # mpls/ldp.cc MPLS # MPLS, MultiProtocol Label Switching ……

  18. Next week 抽考 • 把common header的unique id與timestamp隨著每個封包傳送,利用cout印出來。

  19. ~/ns2.31/common/Packet.h

More Related