Sie sind auf Seite 1von 15

Accessing Training Rack Units Via Console/SSH Session

Access the terminal server by SSH to 98.159.241.3 or training.sandvine.com on port 2222.

It is highly recommended that you save these settings in Putty/SecureCRT as you will be returning to the training
rack multiple times throughout the course.

Logging In

Login: student1
Password: (Please ask or contact the instructor for the current password)

This should bring up a menu to let you access the 24Ks, 22Ks, 14Ks and 8210s.

The menu will let you SSH to the units by typing the correct letter number sequence.

SSH Connection (type s + unit selection)

If you do not know which device you should select, ask the instructor which one you have been assigned for the
class.

If you SSH in you should only be prompted for a password, which is sandvine, as the log in will have been initiated
using the sv_admin user.

Once you are at a command prompt on a 14K, 22K or 24K element you will notice that even though you logged in as
sv_admin youre currently in the sv_operator security gruop. Use the sv_enable command to escalate to sv_admin
privileges:

(hostname:sv_operator)$ sv_enable sv_admin


(hostname:sv_admin)$

Change to Default Directory

Once you have escalated your privileges to sv_admin, the next thing you should do is change to the directory where
all the work you do in this class will occur:

(hostname:sv_admin)$ cd /usr/local/sandvine/etc

PTS Training Lab Guide -1


Sandvine Inc.
Table of Contents

Lab 1 Policy Evaluation .................................................................................................... 3


Lab 2 Policy Scopes ......................................................................................................... 4
Lab 3 Policy Groups ......................................................................................................... 5
Lab 4 Policy Assembly Language .................................................................................... 6
Lab 5 Node Qualifiers....................................................................................................... 7
Lab 6 Measurements and Classifiers ............................................................................... 9
Lab 7 Measurement Groups ........................................................................................... 11
Lab 8 - Tables ................................................................................................................... 12
Lab 9 Maps .................................................................................................................... 14
Lab 10 Timers ................................................................................................................ 15

PTS Training Lab Guide -2


Sandvine Inc.
Lab Activities
Lab 1 Policy Evaluation
Fill in the correct number beside each entry in the list of keywords, below.

_____ Internet _____ PTSM

_____ PTSD _____ Switch Fabric

_____ Internet Port _____ Data1

_____ NPU _____ Subscriber Port

_____ Subscriber _____ Data2

PTS Training Lab Guide -3


Sandvine Inc.
Lab 2 Policy Scopes
For the following policy expressions, indicate the scope it falls into:

2.1 if expr(Flow.IsEnd) then ...


2.2 if expr(Timer.MyTimer.Expired) then ...
2.3 if protocol bittorrent then ...
2.4 if expr(Subscriber.IsMapped) then ...
2.5 if client attribute tier = silver then ...
2.6 measurement MyMeasurement bitrate to subscriber
2.7 measurement MyMeasurement hosts over publish_interval

PTS Training Lab Guide -4


Sandvine Inc.
Lab 3 Policy Groups
3.1 Optimize the following policy using Policy Groups:

if subscriber class sub_1 and protocol itunes then shape


if subscriber class sub_1 and protocol bittorrent then block
if subscriber class sub_1 and protocol netflix then divert
if subscriber class sub_1 and protocol ares then block
if subscriber class sub_1 then count subscriber protocol

3.2 Optimize the following policy using Policy Groups:

if protocol http and (time hours 0800-1700) then divert


if protocol http and not (time hours 0800-1700) then allow

PTS Training Lab Guide -5


Sandvine Inc.
Lab 4 Policy Assembly Language
4.1 Idenfity the type of the PAL field used in the following expressions, then look up the PAL field
in the guide and find out what it does.

a) Flow.NowDiverted
b) Flow.ApplicationProtocol.IsNew
c) Flow.SessionProtocol
d) Flow.Client.HandshakeRTT
e) Flow.Subscriber.IpAddress
f) Flow.Client.Stream.HTTP.UserAgent
g) Session.IpPrefix
h) Session.Subscriber.Attribute.<AttributeName>

4.2 Define a macro that will return a boolean indicating if a flow is one of the following protocols:
amazonvideo, bbciplayer, cnn, lastfm, netflix, pandoraradio

4.3 Define a macro that will accomplish the same thing as the one in #2, however this time make
it more general so that it will return true if a flow is one of the protocols in the corresponding
application type.

PTS Training Lab Guide -6


Sandvine Inc.
Lab 5 Node Qualifiers

5.1 Identify the direction of traffic being affected in the following cases:

if client class external then shape to server shaper Lab1

if sender class sub_1 then shape to receiver shaper Lab1

if true then shape to internet shaper Lab1

if subscriber class sub_1 then \


shape to subscriber shaper Lab1 and \
shape to internet shaper Lab1_2

if not server class external then shape to client shaper Lab1

5.2 Why would these two measurements result in different values?

measurement BittorrentRateUp1 bitrate from subscriber \


where protocol bittorrent

measurement BittorrentRateUp2 bitrate from client \


where server class external and \
protocol bittorrent

PTS Training Lab Guide -7


Sandvine Inc.
5.3 Rewrite the following block of policy to use the subscriber and internet node qualifiers:

#
# Define attribute name and possible values
#
attribute "tier" type string
#
# Define shapers per tier
#
shaper "gold_down" 100Kbps
shaper "gold_up" 50Kbps
shaper "silver_down" 80Kbps
shaper "silver_up" 20Kbps
shaper "bronze_down" 50Kbps
shaper "bronze_up" 5Kbps
#
# Create policy to define what shapers to use for each service tier.
# Using "per subscriber" shaping, unique by client/server-ip.
#
PolicyGroup {
if client "tier"="gold" then \
shape to client shaper "gold_down" unique by client-ip and \
shape to server shaper "gold_up" unique by client-ip
if server "tier"="gold" then \
shape to server shaper "gold_down" unique by server-ip and \
shape to client shaper "gold_up" unique by server-ip
if client "tier"="silver" then \
shape to client shaper "silver_down" unique by client-ip and \
shape to server shaper "silver_up" unique by client-ip
if server "tier"="silver" then \
shape to server shaper "silver_down" unique by server-ip and \
shape to client shaper "silver_up" unique by server-ip
if client "tier"="bronze" then \
shape to client shaper "bronze_down" unique by client-ip and \
shape to server shaper "bronze_up" unique by client-ip
if server "tier"="bronze" then \
shape to server shaper "bronze_down" unique by server-ip and \
shape to client shaper "bronze_up" unique by server-ip
}

PTS Training Lab Guide -8


Sandvine Inc.
Lab 6 Measurements and Classifiers

6.1 HappyISP is interested in operational data related to the use of the bittorrent protocol on their
network. Specifically, they are interested in the amount of data that leaves their network via
bittorrent as well as the total duration of all those flows.

6.1.1 Create a measurement to keep track of the total bytes of bittorrent traffic uploaded. Make
sure you can publish this measurement.

6.1.2 Define a generic measurement to keep track of the total duration of all bittorrent flows. Make
sure you can publish this measurement.

6.1.3 Write policy to update the measurement you defined in 6.1.2.

6.1.4 Publish the measurements you created in 6.1.1 and 6.1.2.

6.1.5 Bonus: Rewrite the measurement you defined in 6.1.2 using a sum measurement instead of
a generic measurement.

6.2 HappyISP has 3 service tiers they sell to their customers: bronze, silver and gold. The
marketing department requires data on these service tiers to assess the performance of their
plans. Develop custom measurements and publish them to the SPB so that NDS reports can be
generated to illustrate this data.

6.2.1 Measurements to track the total bytes transmitted and received per service tier.
6.2.2 A measurement to track the number of connections per service tier.
6.2.3 A measurement to track the bytes downloaded per service tier and per protocol.
6.2.4 Publish the measurements you created in 6.2.1, 6.2.2 and 6.2.3. For measurement 6.2.2,
publish the peak connections per service tier.

Your policy file already has the following in it:

#
# Define tier attribute
#
attribute "tier" type string

Hint: You will need a classifier!

PTS Training Lab Guide -9


Sandvine Inc.
6.3 The marketing department comes back to you and says that the per protocol measurement
you created in 6.2.3 is too granular.

6.3.1 Modify the measurement so that it is per service tier and per protocol category, with the
following categories: peer to peer, web browsing and email, real time entertainment, real time
communications, other.

Here is the list of protocols present on HappyISPs network:

Protocol Type Keyword


Gnutella Peer to Peer gnutella
Filetopia Peer to Peer filetopia
Google Talk Real Time Communications googletalk
NetBIOS Over TCP/IP Bulk Transfer netbios
Network News Transfer Protocol Bulk Transfer nntp
Open Fasttrack Peer to Peer openft
PC Anywhere Remote Connectivity pcanywhere
eDonkey Peer to Peer edonkey
Pop Folder Network Storage popfolder
Battlefield 2 Gaming pcgames_battlefield2
SMTP Email smtp
Youtube Real Time Entertainment youtube
Bittorrent Peer to Peer bittorrent
GOM TV Real Time Entertainment gomtv
Net 2 Phone Real Time Communications net2phone
Skype Real Time Communications skype
Ares Peer to Peer ares
Http Web Browsing http
iTunes Real Time Entertainment itunes_mediadownload

Rewrite the measurement you create in 6.2.3 so that it is per tier and per protocol category.

Hint #1: Use the PAL function Flow.IsApplicationProtocol.


Hint #2: You will need a second classifier to categorize the traffic!

6.4 Rewrite the measurement you created in 6.3.1 to use the built-in application types available
through the loadable traffic identification package.

Hint: Theres a specific PAL field you need to do this.

PTS Training Lab Guide - 10


Sandvine Inc.
Lab 7 Measurement Groups

7.1 Optimize the following block of policy using measurement groups:

measurement "BittorrentConnectionsUp1" connections \


where server class "external" and \
protocol "bittorrent"

measurement "BittorrentBytesUp1" sum(Flow.Client.Tx.Bytes) \


where server class "external" and \
protocol "bittorrent"

measurement "BittorrentRateUp1" bitrate from client \


where server class "external" and \
protocol "bittorrent"

7.1.1 Verify that your use of the MeasurementGroup is correct by putting it in policy.conf along with the
above measurements. The values should match in the output of show policy measurements.

7.2 Optimize the following block of policy using measurement groups:

measurement "HttpFlows" sum(1) \


where (expr(Flow.IsNew) and \
protocol "http")

measurement "PrimetimeHttpFlows" sum(1) \


where (expr(Flow.IsNew) and \
protocol "http" and \
(time hours 1700-2300))

measurement "ShapedHttpFlows" sum(1) \


where (expr(Flow.IsShaped) and \
protocol "http")

measurement "PrimetimeShapedHttpFlows" sum(1) \


where (expr(Flow.IsShaped) and \
protocol "http" and \
(time hours 1700-2300))

PTS Training Lab Guide - 11


Sandvine Inc.
Lab 8 - Tables
8.1 Define a table that will store one string and one integer for every subscriber where the rows in
the table never time out.

8.1.1 Write a policy statement to insert a value into the table you defined in 8.1.

8.1.2 Write a policy statement to delete the row you added in 8.1.1.

8.2 Define a table that will store one integer that defaults to 0 for each flow where a row in the
table will time out after 60 seconds unless you read or write a value to it.

8.2.1 Write a policy statement to insert a value into the table you defined in 8.2.

8.2.2 Write a policy statement to delete the row you added in 8.2.1.

PTS Training Lab Guide - 12


Sandvine Inc.
8.3 You have a table defined as follows:

table t (integer col1, string col2) timeout none unique by


(IpAssignment.IpAddress)

Row Index col1 col2


4.0.0.0 0 is
4.0.0.1 1 if
4.0.0.2 1 measurement
4.0.0.3 2 shaping
4.0.0.4 3 true
4.0.0.5 5 winter
4.0.0.6 8 policy
4.0.0.7 13 http
4.0.0.9 21 protocol
4.0.0.10 34 fun
4.0.0.11 55 cold
4.0.0.12 89 captive_portal
4.0.0.13 144 learning
4.0.0.14 233 then
4.0.0.15 377 count

8.3.1 Use the following policy to figure out what the secret message and secret code are:

string secret_message =
int secret_code = 0

Table.t:cursor "row" = Table.t[4.0.0.13]


if true then Concat(secret_message,row.col2) and increment secret_code by row.col1

row = Table.t[4.0.0.6]
if true then Concat(secret_message,row.col2) and increment secret_code by row.col1

row = Table.t[4.0.0.0]
if true then Concat(secret_message,row.col2) and increment secret_code by row.col1

row = Table.t[4.0.0.10]
if true then Concat(secret_message,row.col2) and increment secret_code by row.col1

PTS Training Lab Guide - 13


Sandvine Inc.
Lab 9 Maps
9.1 Declare a string map that will perform case sensitive lookups on the key, store an integer
label for each entry and be populated from the file /usr/local/sandvine/etc/maps/my_map.txt.

9.1.1 Create the file my_map.txt and put 3 entries in it so that that the map you declared in 9.1
will have something to load and your policy will reload properly.

9.1.2 Execute show policy maps to verify that your map loaded correctly.

9.1.3 Update the file my_map.txt by adding another entry. Refresh the map data only do not
do a full policy reload.

9.1.4 Execute show policy maps again to verify that the new entry is in the map without having
to do a full reload of policy.

PTS Training Lab Guide - 14


Sandvine Inc.
Lab 10 Timers
10.1 Create a measurement that keeps track of the number of new flows.

10.1.1 Define a repeating timer that fires every minute.

10.1.2 You cannot publish a measurement that is over a 1 minute interval. When the timer you
defined in 10.1.1 expires, write the measurement you defined in 10.1 to /var/log/svlog so you can
keep track of it.

log values("New flows in last minute:", Measurement.NewFlowsPerMinute)

10.1.3 Watch /var/log/svlog through the show log command and make sure the values are being
written to it as expected.

PTS Training Lab Guide - 15


Sandvine Inc.

Das könnte Ihnen auch gefallen