tutorial5 addingmorenodes 120206080917 phpapp02

Upload: normalia-samian

Post on 06-Jul-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    1/17

    By

    Mohammed Amer Al-Batati

    OMNet+

    +Step by Step

    Part - 5

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    2/17

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    3/17

    et"# modi*y our plan$ ,hen a node de!ide# totran#mit a me##a(e& it ha)e to #ele!t arandom de#tination$ %here*ore& we need tomodi*y Node$!! 'le$

    Addin( More Node# - !ont$

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    4/17

    oto to .mynetwor/- add more node# -!onne!t them to ea!h other then run theeperiment$ A# *ollow#

    Addin( More Node# - !ont$

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    5/17

    Me##a(e#3ependin( on the model domain& me##a(e

    ob4e!t# repre#ent e)ent#& pa!et#& !ommand#& 4ob#& !u#tomer# or other ind# o* entitie#$

     %here are !Me##a(e and !Pa!et la##e#$

     %he !Pa!et !la## etend# !Me##a(e$

    !Pa!et i# u#ed *or networ pa!et# 6*rame#&data(ram#& tran#port pa!et#& et!$7 in a

    !ommuni!ation networ& and !Me##a(e i# u#ed*or e)erythin( el#e$8or eample& en!ap#ulation and de!ap#ulation

    operation# are only u#ed with !Pa!et$

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    6/17

    Me##a(e# 9 Ba#i! :#a(e!Me##a(e ;m#( < new cMessage();

    !Me##a(e ;m#( < new cMessage("timer");

    !Me##a(e ;m#( < new cMessage("timer",kind);

    m#(-#et=ind6 ind 7>

    m#(-#etBiten(th6 len(th 7>

    m#(-#et%ime#tamp6 #imtime 7>

    int K = msg->getKind();int L = msg->getBitLength();

    #imtime?t % < m#(-(et%ime#tamp67>

    @et!

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    7/17

    Me##a(e# 9 3upli!atin( Me##a(e#

    !Me##a(e ;!opy < m#(-dup67>

    … one slide…

    …one line…

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    8/17

    Me##a(e# 9 n!ap#ulationample

    IP

    MA

    MA IP

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    9/17

    In#pe!tin( !Me##a(e ob4e!t# 6pre)iou# !ode7$

    Me##a(e# 9 n!ap#ulation 9!ont$

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    10/17

    Modi*y Node$!! !ode to in!lude the en!ap#ulationeample$

    Sa)e& build and run$

    Me##a(e# 9 n!ap#ulation 9!ont$

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    11/17

    In#pe!tin( !Pa!et ob4e!t# 6new !ode7$

    Me##a(e# 9 n!ap#ulation 9!ont$

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    12/17

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    13/17

    A##ume that you want to add your ownheader between IP and MA$

    3e'ne our Own Me##a(e

    IPMA

    MyCeader

    Name ID Year

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    14/17

    A##ume that you want to add your ownheader between IP and MA$

    3e'ne our Own Me##a(e

    IPMA

    MyCeader

    Name ID Year

      !  L  "  

    #   

    $  N  %   !  D  

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    15/17

    8rom Pro4e!t plorer ri(ht-!li! on mypro4e!t- New - Me##a(e 3e'nition 6$m#(7 - nameit 6myCeader7 - Net - Sele!t New Me##a(e8ile - Net - 8ini#h$

    Add our 'eld#

    Sa)e and Build$

    3e'ne our Own Me##a(e -!ont$

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    16/17

    OMNet++ (enerate# $!! and $h6myCeader?m$!! and myCeader?m$h7$

     our need# are (enerated$

    Cow to u#e it$

    3e'ne our Own Me##a(e -!ont$

  • 8/17/2019 Tutorial5 Addingmorenodes 120206080917 Phpapp02

    17/17

     %o u#e your new me##a(e1$ In!lude the needed header$

    2$ :#e .myCeader/ a# .!Pa!et/

    D$  %hat i# itE

    In#ert it between IP and MA

    3e'ne our Own Me##a(e -!ont$

    AtNode$!!