#### ASpath-tree v.4.2 - Released on Thu APR 17 2003, h.16:58:12 #### File: lib/create-homepage.pl Last modified on Fri MAR 14 2003, h.15:42:13 use vars qw ($MAINCOLOR $LINKCOLOR $LINESDETTABLECOLOR $SMALLBOLDCOLOR $MEDIUMBOLDCOLOR); $MAINCOLOR = '#00009D'; $LINKCOLOR = '#00009D'; $VLINKCOLOR = '#00009D'; $LINESDETTABLECOLOR = '#C0C0C0'; $SMALLBOLDCOLOR = '#000000'; $MEDIUMBOLDCOLOR = '#000000'; # Routines to create the home page sub home_page { my ($inumtable, $inumelab, $iasdist) = @_; &crea_bgp_page ($inumtable, $inumelab, $iasdist); return(0); } sub crea_bgp_page { my ($inumtable, $inumelab, $iasdist) = @_; my ($routesum, $sixto4link, $note, $privaslink, $resaslink); my $out_file = "$HTMLDIR_LOCAL/bgp.html"; open (OUT_FILE,">$out_file") or die "Can't open $out_file: $!\n"; print OUT_FILE &header("IPv6 BGP Operational Report from $SITENAME", 0); print OUT_FILE " \n"; print OUT_FILE "\n"; print OUT_FILE " "; print OUT_FILE " \n"; print OUT_FILE " "; print OUT_FILE " \n
\n\n"; if ($SITEPICTURE) { print OUT_FILE "\n"; } print OUT_FILE "\n"; print OUT_FILE "
 IPv6 BGP Operational Report from $SITENAME
\n
\"\"
\"\"
\"\"
Latest snapshot of the IPv6 BPG table
$LONGDATE

Route summary
\n"; if (ROUTER =~ /^JUNIPER$/i) {$routesum = 'Active/Total'} else {$routesum = 'Best/Total'} print OUT_FILE " \n"; if ($$inumtable{suppressed}) { print OUT_FILE " \n"; } if ($$inumtable{damped}) { print OUT_FILE " \n"; } if ($$inumtable{history}) { print OUT_FILE " \n"; } if ($$inumtable{RIBfailure}) { print OUT_FILE " \n"; } print OUT_FILE "
$routesum routes: $$inumtable{best}\/ $$inumtable{valid}
Suppressed routes: $$inumtable{suppressed}
Damped routes: $$inumtable{damped}
History routes: $$inumtable{history}
RIB failure routes: $$inumtable{RIBfailure}
\n"; if ($$inumelab{ASintrees}) { if ($$inumelab{privAS}) {$privaslink = "private AS numbers"} else {$privaslink = "private AS numbers"} if ($$inumelab{reservedAS}) {$resaslink = "reserved AS numbers"} else {$resaslink = "reserved AS numbers"} print OUT_FILE "

Number of ASs in table: $$inumelab{ASintrees}\/$$inumtable{ASs}
(within active routes\/within total routes)
Among the ASs in active routes
originating only ASs: $$inumelab{origAS}
originating/transit ASs: $$inumelab{bothAS}
transit only ASs: $$inumelab{transitAS}
$privaslink: $$inumelab{privAS}
$resaslink: $$inumelab{reservedAS}
\n"; } if ($$inumelab{ASpaths}) { print OUT_FILE "

Number of active AS paths: $$inumelab{ASpaths}\n"; } print OUT_FILE "

Number of active peers: $$inumelab{activePEERS}\n"; # Calculate distance stats my ($sum, $prod, $sumlong) = (0, 0, 0); foreach $key (sort {$a <=> $b} (keys(%$iasdist))) { $sum += $$iasdist{$key}; $prod += $key*$$iasdist{$key}; if ($key > 4) {$sumlong += $$iasdist{$key}} } if ($sum) { my @hops = (' 1', ' 2', ' 3', ' 4', '>4'); my @perc = (); my $tmp; my ($perclen, $abslen) = (0, 0); for ($i=0;$i<4;$i++) { $tmp = $$iasdist{$i+1}/$sum*100; $perc[$i] = &trunc_number($tmp, 0);; if ($perclen < length($perc[$i])) {$perclen = length($perc[$i])} if ($abslen < length($$iasdist{$i+1})) {$abslen = length($$iasdist{$i+1})} } $tmp = $sumlong/$sum*100; $perc[4] = &trunc_number($tmp, 0);; if ($perclen < length($perc[4])) {$perclen = length($perc[4])} if ($abslen < length($sumlong)) {$abslen = length($sumlong)} # cleaning up percentages $sum = $perc[0]+$perc[1]+$perc[2]+$perc[3]+$perc[4]; if($sum <100) {for ($i=4;$>=0;$i--) {if ($perc[$i] > 0) {$perc[$i] += (100-$sum)};last}} if($sum >100) {for ($i=4;$>=0;$i--) {if (($perc[$i] - $sum +100) > 0) {$perc[$i] += ($sum-100)};last}} print OUT_FILE "

AS distance
\n"; my ($absval, $percval); for ($i=0;$i<5;$i++) { $percval = (' ' x ($perclen - length($perc[$i]))) . $perc[$i]; $tmp = $$iasdist{$i+1}; if ($i == 4) {$tmp = $sumlong} $absval = (' ' x ($abslen - length($tmp))) . $tmp; print OUT_FILE " \n"; } print OUT_FILE "
\ \ Crossed ASs\ \ \ \ Prefixes\ \ \ \ Perc.\ \ 
$hops[$i]$absval$percval\%
"; print OUT_FILE " Average: $$inumelab{averageDIST} crossed ASs\n"; } print OUT_FILE "

Graphic display of: \n"; if ($$inumelab{N_6to4}) {$sixto4link = "
  • the 6to4 prefix"} print OUT_FILE " Prefix analysis(*):
    • $$inumelab{N_ptlas} 6Bone pTLAs
    • $$inumelab{N_otherIANA} prefixes assigned by RIRs (prefix length in range [29,35]) $sixto4link\n"; if ($$inumelab{N_invalid} || $$inumelab{N_unaggr} || $$inumelab{N_longer6to4}) { print OUT_FILE "
    • the following odd routes:
      • $$inumelab{N_invalid} invalid prefixes (out of allocated public address space)
      • $$inumelab{N_unaggr} unaggregated prefixes, sorted by origin AS and by xTLA owner
      • \n"; if ($$inumelab{N_longer6to4}) { print OUT_FILE "
      • $$inumelab{N_longer6to4} 6to4 longer prefixes
      • \n"; } } else {print OUT_FILE "
      • no odd routes
      • \n"} print OUT_FILE "
      \n
    \n"; $note = "(*) Excluding prefixes with local origin (no associated AS paths)"; if ($FILTEROUT == 1) {$note .= " and prefixes within suppressed routes"} elsif ($FILTEROUT == 2) {$note .= " and prefixes within suppressed routes learned through iBGP"} print OUT_FILE " $note\.

    \n"; print OUT_FILE " Routing stability analysis during the last 24 hours for:

  • \"\"
    \"\"
    \"\"
    \n"; print OUT_FILE &footer; print OUT_FILE "
    \n\n\n"; close (OUT_FILE); return(0); } sub header { my ($title, $flag) = @_; my $text = " $title \n"; return($text); } sub footer { my $footer = "This page has been produced using the ASpath-tree tool ($VER), developed at Telecom Italia Lab (formerly CSELT).
    Questions and comments to: $CONTACTNAME\n"; return($footer); } (1); #### ASpath-tree v.4.2 - Released on Thu APR 17 2003, h.16:58:12 #### File: lib/create-homepage.pl Last modified on Fri MAR 14 2003, h.15:42:13