// Use dokuwiki graphviz plugin to describe a network

Graphviz plugin allows embedding of .dot graphs into dokuwiki pages, put a graph description inside the tag <graphviz> is enough to accomplish this task, for more info about graphviz and the plugin installation see references below.

Goal

Use .dot file to describe graphically a not so unusual network scenario with InterNET, DMZ and LAN.

Structures

Hub-like object

To describe a lan where many machines are connected dot provides a primitive type named record.

Each cell of a record is identified by the id surrounded by angle brackets.

To address a cell you must use the syntax “<record id>:<cell id>”.

    ...
    INET [shape=record,width=.1, height=.1, label="<0>InterNET        |<1>|<2>|<3>|<4>|<5>|<6>|<7>|<8>|<9>|<10>|<11>|"];
    ...

Use ranking to pretty place machines

To allow a good placement of machines items we can use the rank = same attribute to align group of items to invisible rank generator objects.

And then:

     { rank = same; inv1; Alpha; Gamma; }

Graphical vs. logical edges placement

When an arrow has an opposite direction then the diagram (rankdir attribute) I strongly recommend to follow the diagram direction and set the dir attribute with the value back.

    ...
    INET:2 -> Alpha [dir=back];
    ...

Nodes

A node port is a point where edges can attach to a node. If you want to specify where an edge is connected to an object you can use headport and tailport attributes specifying the compass point that you prefer “n”, “ne”, … .

    ...
    INET:10 -> Gold [dir=back, headport=e, tailport=s];
    INET:11 -> Platinum [dir=back, headport=e, tailport=s];
    ...

The code

Here all the code required to compose the diagram.

digraph structs {
    size = "5,5";
    bgcolor="#F0EADB";
    node [shape=box, width=.1, height=.1, layer=all];
    edge [layer=all];
    
    constraint = false;
    nodesep = .1;
    ranksep = .3;
 
    {
        node [style=invis];
        inv1; inv2; inv3; inv4;
    }

    INET [shape=record,width=.1, height=.1, label="<0>InterNET        |<1>|<2>|<3>|<4>|<5>|<6>|<7>|<8>|<9>|<10>|<11>|"];
    DMZ [shape=record,width=.1, height=.1, label="<0>DMZ 192.168.72.0/24|<1>|<2>|<3>|<4>|<5>|<6>|<7>|<8>|<9>|<10>|<11>|"];
    LAN [shape=record,width=.1, height=.1, label="<0>LAN 192.168.1.0/24|<1>|<2>|<3>|<4>|<5>|<6>|<7>|<8>|<9>|<10>|<11>|"];

    INET:0 -> inv1 -> inv2 -> DMZ:0 -> inv3 -> inv4 -> LAN:0 [style=invis];

    { rank = same; inv1; Alpha; Gamma; }
    { rank = same; inv2; Beta; } 

    INET:2 -> Alpha [dir=back];
    INET:5 -> Beta [dir=back];
    INET:8 -> Gamma [dir=back];
    Alpha -> DMZ:2;
    Beta -> DMZ:5;
    Gamma -> DMZ:8;    

    { rank = same; inv3; Gold; }
    { rank = same; inv4; Silver; Platinum;} 

    DMZ:2 -> Silver [dir=back];
    DMZ:5 -> Gold [dir=back];
    DMZ:8 -> Platinum [dir=back];
    Silver -> LAN:2;
    Gold -> LAN:5;
    Platinum -> LAN:8;    

    INET:10 -> Gold [dir=back, headport=e, tailport=s];
    INET:11 -> Platinum [dir=back, headport=e, tailport=s];
}

Conclusions

Keeping in mind that digraph's diagrams are oriented and that exists some rules to change it's rendering behavior you can reach a great control on its output.

References

Comments

Stuartpn
No. 1 @ 2016/10/18 11:42

find a pharmacy near me <a href=http://zolpidem.wifeo.com/>acheter zolpidem en belgique</a> kroger pharmacy rome ga

Douglasbup
No. 2 @ 2016/11/11 09:47

kaiser pharmacy rancho cordova <a href=http://reductil.creatupropiaweb.com/>comprar reductil por internet</a> medicine for runny nose

Williamdek
No. 3 @ 2016/12/13 18:18

certification programs in healthcare <a href=http://methylphenidate.eventsbot.com/>buy methylphenidate hydrochloride</a> energy pills with ephedra

AnthonyPt
No. 4 @ 2016/12/14 08:36

united healthcare employer services <a href=http://tramadol.sitego.fr/>acheter tramadol pas cher</a> buy asthma inhalers online no prescription

CharlesCem
No. 5 @ 2016/12/15 02:10

prescription medicine for itching <a href=http://metilfenidato.logdown.com/>comprar metilfenidato online</a> watch doctor who season 1 episode 2

RobertNal
No. 6 @ 2016/12/15 16:16

samsung galaxy s4 tablet <a href=http://trankimazin.mex.tl/>http://trankimazin.mex.tl/</a> lean methodology in healthcare

StevenHist
No. 7 @ 2016/12/16 14:21

nevada state pharmacy board <a href=http://reductil.asso-web.com/>acheter reductil 15 mg en ligne</a> penn state health insurance

Charlesbab
No. 8 @ 2016/12/31 14:27

vicodin no prescription needed <a href=http://www.iktorivil.hundpoolen.se/>kopa iktorivil</a> diet pills with ephedra

Charlesbab
No. 9 @ 2017/01/02 22:40

sams club pharmacy hours of operation <a href=http://meridia.top-depart.com/>acheter meridia en ligne</a> benefits of green coffee pills

Charlesbab
No. 10 @ 2017/01/10 11:06

hair follicle drug test how long <a href=http://tavor.soup.io/>tavor kaufen</a> birth defects caused by drugs

Charlesbab
No. 11 @ 2017/01/11 00:23

family medicine at greenhill <a href=http://qsymia.tribalpages.com/>buy qsymia online pharmacy</a> blue non prescription contacts

Clintonflouh
No. 12 @ 2017/01/20 05:33

Tinedol – эффективное средство от грибка стопы, неприятного запаха и зуда. Перейти на сайт: http://tinedol.1stbest.info/

http://forum.isurgut.ru/viewtopic.php?f=165&t=2115131 - Tinedol – эффективное средство от грибка http://skybird.es/hello-world/#comment-781 - Tinedol – эффективное средство от грибка http://www.outerlimitllc.com/guestbook/index.php?mode=3&post_id=14492 - Tinedol – эффективное средство от грибка

BillyHapse
No. 14 @ 2017/01/21 18:03

wh0cd81905 [url=http://metformin-500mg.cricket/]generic metformin[/url] [url=http://bupropionxl.site/]bupropion xl[/url] [url=http://tadalissx.cricket/]tadalis sx[/url] [url=http://viagra-online-without-prescription.cricket/]purchase viagra online without prescription[/url] [url=http://ciprofloxacin-hcl-500-mg.science/]cipro 500mg dosage[/url]

ErickFag
No. 17 @ 2017/02/02 06:03

wh0cd781125 [url=http://cipro-500-mg.gdn/]cipro[/url] [url=http://albuterol.lol/]get more information[/url] [url=http://bupropion-online.gdn/]bupropion hcl 100 mg[/url] [url=http://vigara.review/]viagra online pharmacy canada[/url]

Winstonamons
No. 18 @ 2017/02/07 23:50

thanks towards this significant revealing website, obstruct up the great jobless check out this [url=http://onlinecasinos-x.com]online casinos[/url] offers

Winstonamons
No. 19 @ 2017/02/08 19:58

thanks benefit of this countless edifying website, living up the skilled work check out this [url=http://onlinecasinos-x.com]casino online[/url] offers

Jasonteask
No. 20 @ 2017/02/14 07:14

agree out this [url=http://onlinecasino-xx.com]online casinos[/url] where you can collect legitimate funds with the help of this guidePlaying [url=http://onlinecasinos-x.com/online-roulette.html]play free roulette[/url]

Leave a comment…



  • E-Mail address will not be published.
  • Formatting:
    //italic//  __underlined__
    **bold**  ''preformatted''
  • Links:
    [[http://example.com]]
    [[http://example.com|Link Text]]
  • Quotation:
    > This is a quote. Don't forget the space in front of the text: "> "
  • Code:
    <code>This is unspecific source code</code>
    <code [lang]>This is specifc [lang] code</code>
    <code php><?php echo 'example'; ?></code>
    Available: html, css, javascript, bash, cpp, …
  • Lists:
    Indent your text by two spaces and use a * for
    each unordered list item or a - for ordered ones.