p4 spec v1.1 (1185620), страница 10

Файл №1185620 p4 spec v1.1 (Домашнее задание) 10 страницаp4 spec v1.1 (1185620) страница 102020-08-25СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 10)

Not all targets may support all primitive actions. Target switches may have limits on when variables are bound and whatcombinations of parameter types are allowed.Here is a brief summary of primitive actions. More detailed documentation is below.5210.1 Primitive Actions10 ACTIONSprimitive nameadd_headercopy_headerremove_headermodify_fieldmodify_field_with_hash_based_offsettruncatedropno_oppushpopcountmetergenerate_digestresubmitrecirculateclone_ingress_pkt_to_ingressclone_egress_pkt_to_ingressclone_ingress_pkt_to_egressclone_egress_pkt_to_egressSummaryAdd a header to the packet’s Parsed RepresentationCopy one header instance to another.Mark a header instance as invalid.Set the value of a field in the packet’s ParsedRepresentation.Apply a field list calculation and use the result to generate an offset value.Truncate the packet on egress.Drop a packet (in the egress pipeline).Placeholder action with no effect.Push all header instances in an array downand add a new header at the top.Pop header instances from the top of an array, moving all subsequent array elementsup.Update a counter.Execute a meter operation.Generate a packet digest and send to a receiver.Resubmit the original packet to the parserwith metadata.Resubmit the packet after all egress modifications.Send a copy of the original packet to theparser.

Alias: clone_i2i.Send a copy of the egress packet to theparser. Alias: clone_e2i.Send a copy of the original packet to theBuffer Mechanism. Alias: clone_i2e.Send a copy of the egress packet to theBuffer Mechanism. Alias: clone_e2e.Table 13: Primitive ActionsParameters of the primitive actions are typed as follows:5310.1 Primitive ActionsNotationHDRARRFLDFLDLISTVALC-REFM-REFR-REFFLC-REF10 ACTIONSType DescriptionThe literal name of a header instance.The name of a header instance array, with no subscript.A field reference of form header_instance.field_name whichrefers to the Parsed Representation.A field list instance declared with field_list.An immediate value or a value from a table entry’s action parameters. The latter is represented as a parameter from theenclosing function (see examples below).The name of a counter array; determined at compile time.The name of a meter array; determined at compile time.The name of a register array; determined at compile time.Field list calculation reference; determined at compile time.Table 14: Action Parameter TypesHere is the API specification for standard primitive actions.add_header(header_instance)SummaryAdd a header to the packet’s Parsed RepresentationParametersheader_(HDR) The name of the header instance to add.instanceDescriptionIf the header_instance is not an element in a header stack, the indicatedheader instance is set valid.

If the header instance was invalid, all itsfields are initialized to 0. If the header instance is already valid, it is notchanged.If header_instance is an element in a header stack, the effect is to pusha new header into the stack at the indicated location. Any existing validinstances from the given index or higher are copied to the next higherindex. The given instance is set to valid.

If the array is fully populatedwhen this operation is executed, then no change is made to the ParsedRepresentation.5410.1 Primitive Actions10 ACTIONScopy_header(destination, source)SummaryCopy one header instance to another.Parametersdestination(HDR) The name of the destination header instance.source(HDR) The name of the source header instance.DescriptionCopy all the field values from the source header instance into the destination header instance. If the source header instance was invalid, thedestination header instance becomes invalid; otherwise the destinationwill be valid after the operation.

The source and destination instancesmust be of the same type.remove_header(header_instance)SummaryMark a header instance as invalid.Parametersheader_(HDR) The name of the header instance to remove.instanceDescriptionIf the header_instance is not an element in a header stack, then theindicated header instance is marked invalid. It will not be available formatching in subsequent match+action stages. The header will not be serialized on egress.

All field values in the header instance become uninitialized.If the header_instance is an element in a header stack, the effect is topop the indicated element from the stack. Any valid instances in thestack at higher indices are copied to the next lower index.5510.1 Primitive Actions10 ACTIONSmodify_field(dest, value [, mask] )SummarySet the value of the given field in packet’s Parsed RepresentationParametersdest(FLD or R-REF) The name of the field instance tomodify (destination).value(VAL, FLD or R-REF) The value to use (source).mask(VAL) An optional mask to use identifying the bits tochange.DescriptionUpdate the indicated field’s value.

The value parameter may be any of:• An immediate value (a number).• A value from the matching entry’s action parameter data; in thiscase, the name of a parameter from the enclosing function is used.• A Parsed Representation field reference.• A register reference.This allows the programmer to copy one field to another. An implicitcast is inserted by the compiler if the types of the source and destinationdiffer, as described in Section 2.4.If the parent header instance of dest is not valid, the action has no effect.

If value is a field reference and its parent header is not valid, theoperation has no effect.If mask is specified, then the field becomes (current_value & ∼ mask)| (value & mask). If mask is not specified, the operation has the effectof a "set", modifying all bits of the destination.5610.1 Primitive Actions10 ACTIONSmodify_field_with_hash_based_offset(dest, base, field_list_calc, size)SummaryAdd a value to a field.Parametersdest(FLD or R-REF) The name of the field instance to bemodified (destination)base(VAL) The base value to use for the index.field_list_(FLC-REF) The field list calculation to use to generatecalcthe hash value.size(VAL) The maximum value to use for the index if > 0.DescriptionThe field list calculation is executed to generate a hash value. If size isnot zero, the hash value is used to generate a value between base and(base + size - 1) by calculating (base + (hash_value % size)).If size is 0 then the value used is (base + hash_value).Normal value conversion takes place when setting dest to the result.truncate(length)SummaryTruncate the packet on egress.Parameterslength(VAL) The number of bytes to transmit.DescriptionIndicate that the packet should be truncated on egress.

The number ofbytes to transmit from the packet is indicated in the parameter to theaction. If the packet has fewer bytes than length, then it will not bechanged.Normally this action would be specified on the egress pipeline, thoughthis is not required.5710.1 Primitive Actions10 ACTIONSdrop()SummaryDrop the packet on egress.DescriptionIndicate that the packet should not be transmitted.

This primitive is intended for the egress pipeline where it is the only way to indicate that thepacket should not be transmitted. On the ingress pipeline, this primitiveis equivalent to setting the egress_spec metadata to a drop value (specific to the target).If executed on the ingress pipeline, the packet will continue throughthe end of the pipeline. A subsequent table may change the value ofegress_spec which will override the drop action. The action cannot beoverridden in the egress pipeline.no_op()SummaryTake no action.DescriptionThis indicates that no action should be taken on the packet.

Controlflow continues as per the current control function specification.push(array [, count])SummaryPush all header instances in an array down and add a new header at thetop.Parametersarray(ARR) The name of the instance array to be modified.count(VAL) An optional value indicating the number of elements to push, by default 1.DescriptionThis primitive is used to make room for a new element in an array ofheader instances without knowing in advance how many elements arealready valid. An element at index N will be moved to index N+1, andthe element at index 0 will be zeroed out and set valid.If a count is specified, elements will be shifted by count instead of 1 andcount header instances will be zeroed and set valid.This primitive leaves the array’s size constant; if an array is already full,elements pushed to indices beyond the static array size will be lost.5810.1 Primitive Actions10 ACTIONSpop(array [, count])SummaryPop header instances from the top of an array, moving all subsequentarray elements up.Parametersarray(ARR) The name of the instance array to be modified.count(VAL) An optional value indicating the number of elements to pop, by default 1.DescriptionThis primitive is used to remove elements from an array of header instances without knowing in advance how many elements are alreadyvalid.

Характеристики

Тип файла
PDF-файл
Размер
1,13 Mb
Тип материала
Высшее учебное заведение

Список файлов курсовой работы

Домашнее задание
VasilenkoAE_521 (switch openflow start)
staticNAT
p4factory
mininet
lvk_demo.py
targets
lvk_task
openflow_mapping
l2.py
l2.pyc
mapping_common.py
mapping_common.pyc
p4src
includes
headers.p4
parser.p4
lvk_task.p4
targets
libpd_thrift
libtbl_packing
tests
pd_thrift
conn_mgr_pd_rpc
__init__.py
__init__.pyc
conn_mgr-remote.
conn_mgr.py
conn_mgr.pyc
constants.py
ttypes.py
ttypes.pyc
devport_mgr_pd_rpc
Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6556
Авторов
на СтудИзбе
299
Средний доход
с одного платного файла
Обучение Подробнее